<commit_before><?php
/**
* $Id: Mysqli.php,v 1.2 2006-01-02 16:51:29 thorstenr Exp $
*
* db_mysqli
*
* The db_mysqli class provides methods and functions for a MySQL 4.1.x 
* and 5.0.x database.
*
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @package      db_mysqli
* @since        2005-02-21
* @copyright:   (c) 2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

class db_mysqli
{
    /**
     * The connection object
     *
     * @var   mixed
     * @see   connect(), query(), dbclose()
     */
	var $conn = false;
    
    /**
     * The query log string
     *
     * @var   string
     * @see   query()
     */
	var $sqllog = "";
	
    /**
     * Constructor
     *
     * @access  public
     * @author  <NAME> <<EMAIL>>
     * @since   2005-02-21
     */
    function __construct()
    {
    }
    
    /**
     * Connects to the database.
     *
     * This function connects to a MySQL database
     *
     * @param   string $host
     * @param   string $username
     * @param   string $password
     * @param   string $db_name
     * @return  boolean true, if connected, otherwise false
     * @access  public
     * @author  <NAME>ne <<EMAIL>>
     * @since   2005-02-21
     */
	function connect ($host, $user, $passwd, $db)
    {
		$this->conn = new mysqli($host, $user, $passwd, $db);
		if (mysqli_connect_errno()) {
            print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
            print "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
            print "<head>\n";
            print "    <title>phpMyFAQ Error</title>\n";
            print "    <meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=utf-8\" />\n";
            print "</head>\n";
            print "<body>\n";
            print "<p align=\"center\">The connection to the MySQL server could not be established.</p>\n";
            print "<p align=\"center\">The error message of the MySQL server:<br />".$this->conn->error()."</p>\n";
            print "</body>\n";
            print "</html>";
            return false;
        }
		return true;
    }
	
    
    
    /**
     * Sends a query to the database.
     *
     * This function sends a query to the database.<commit_msg>Bugfix: use correct error function<commit_after><?php
/**
* $Id: Mysqli.php,v 1.3 2006-03-11 21:49:21 thorstenr Exp $
*
* db_mysqli
*
* The db_mysqli class provides methods and functions for a MySQL 4.1.x 
* and 5.0.x database.
*
* @author       <NAME> <<EMAIL>>
* @author       <NAME> <<EMAIL>>
* @package      db_mysqli
* @since        2005-02-21
* @copyright:   (c) 2006 phpMyFAQ Team
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*/

class db_mysqli
{
    /**
     * The connection object
     *
     * @var   mixed
     * @see   connect(), query(), dbclose()
     */
	var $conn = false;
    
    /**
     * The query log string
     *
     * @var   string
     * @see   query()
     */
	var $sqllog = "";
	
    /**
     * Constructor
     *
     * @access  public
     * @author  <NAME> <<EMAIL>>
     * @since   2005-02-21
     */
    function __construct()
    {
    }
    
    /**
     * Connects to the database.
     *
     * This function connects to a MySQL database
     *
     * @param   string $host
     * @param   string $username
     * @param   string $password
     * @param   string $db_name
     * @return  boolean true, if connected, otherwise false
     * @access  public
     * @author  <NAME> <<EMAIL>>
     * @since   2005-02-21
     */
	function connect ($host, $user, $passwd, $db)
    {
		$this->conn = new mysqli($host, $user, $passwd, $db);
		if (mysqli_connect_errno()) {
            print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
            print "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
            print "<head>\n";
            print "    <title>phpMyFAQ Error</title>\n";
            print "    <meta http-equiv=\"content-type\" content=\"application/xhtml+xml; charset=utf-8\" />\n";
            print "</head>\n";
            print "<body>\n";
            print "<p align=\"center\">The connection to the MySQL server could not be established.</p>\n";
            print "<p align=\"center\">The error message of the MySQL server:<br />".mysqli_connect_error()."</p>\n";
            print "</body>\n";
            print "</html>";
            return false;
        }
		return true;
    }
	
    
    
    /**
     * Sends a query to the database.
     *
     * This function sends a query to the database.
{'fraction_non_alphanumeric': 0.1454936391327719, 'fraction_numerical': 0.02221824045869916, 'mean_word_length': 2.10974930362117, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5371194', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1753, 'n_words': 541}