Vergleich inc/db_mysql.php - 1.6.11 - 1.6.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 416Zeile 416
	 * @param constant The type of array to return.
* @return array The array of results.
*/

	 * @param constant The type of array to return.
* @return array The array of results.
*/

	function fetch_array($query)

	function fetch_array($query, $resulttype=MYSQL_ASSOC)

	{

	{

		$array = mysql_fetch_assoc($query);












		switch($resulttype)
{
case MYSQL_NUM:
case MYSQL_BOTH:
break;
default:
$resulttype = MYSQL_ASSOC;
break;
}

$array = mysql_fetch_array($query, $resulttype);


		return $array;
}


		return $array;
}


Zeile 428Zeile 439
	 * @param resource The query ID.
* @param string The name of the field to return.
* @param int The number of the row to fetch it from.

	 * @param resource The query ID.
* @param string The name of the field to return.
* @param int The number of the row to fetch it from.

	 */

	 */

	function fetch_field($query, $field, $row=false)
{
if($row === false)

	function fetch_field($query, $field, $row=false)
{
if($row === false)

Zeile 437Zeile 448
			return $array[$field];
}
else

			return $array[$field];
}
else

		{

		{

			return mysql_result($query, $row, $field);
}
}

			return mysql_result($query, $row, $field);
}
}

Zeile 455Zeile 466

/**
* Return the number of rows resulting from a query.


/**
* Return the number of rows resulting from a query.

	 *

	 *

	 * @param resource The query ID.
* @return int The number of rows in the result.
*/
function num_rows($query)
{
return mysql_num_rows($query);

	 * @param resource The query ID.
* @return int The number of rows in the result.
*/
function num_rows($query)
{
return mysql_num_rows($query);

	}

/**

	}

/**

	 * Return the last id number of inserted data.
*
* @return int The id number.

	 * Return the last id number of inserted data.
*
* @return int The id number.

Zeile 472Zeile 483
	function insert_id()
{
return mysql_insert_id($this->current_link);

	function insert_id()
{
return mysql_insert_id($this->current_link);

	}


	}


	/**
* Close the connection with the DBMS.
*

	/**
* Close the connection with the DBMS.
*

Zeile 491Zeile 502
	 * Return an error number.
*
* @return int The error number of the current error.

	 * Return an error number.
*
* @return int The error number of the current error.

	 */

	 */

	function error_number()
{
if($this->current_link)

	function error_number()
{
if($this->current_link)

Zeile 518Zeile 529
		else
{
return @mysql_error();

		else
{
return @mysql_error();

		}

		}

	}

/**

	}

/**

Zeile 563Zeile 574
	 * Returns the number of affected rows in a query.
*
* @return int The number of affected rows.

	 * Returns the number of affected rows in a query.
*
* @return int The number of affected rows.

	 */

	 */

	function affected_rows()
{
return mysql_affected_rows($this->current_link);

	function affected_rows()
{
return mysql_affected_rows($this->current_link);

Zeile 706Zeile 717
			$query .= " LIMIT ".$options['limit'];
}
return $this->query($query);

			$query .= " LIMIT ".$options['limit'];
}
return $this->query($query);

	}


	}


	/**
* Build an insert query from an array.
*

	/**
* Build an insert query from an array.
*

Zeile 716Zeile 727
	 * @return int The insert ID if available
*/
function insert_query($table, $array)

	 * @return int The insert ID if available
*/
function insert_query($table, $array)

	{
if(!is_array($array))

	{
if(!is_array($array))

		{
return false;
}

		{
return false;
}

Zeile 780Zeile 791
		}

$comma = "";

		}

$comma = "";

		$query = "";

		$query = "";

		$quote = "'";

		$quote = "'";

		

		

		if($no_quote == true)
{
$quote = "";
}

foreach($array as $field => $value)

		if($no_quote == true)
{
$quote = "";
}

foreach($array as $field => $value)

		{

		{

			$query .= $comma."`".$field."`={$quote}{$value}{$quote}";
$comma = ', ';

			$query .= $comma."`".$field."`={$quote}{$value}{$quote}";
$comma = ', ';

		}

if(!empty($where))
{
$query .= " WHERE $where";
}


		}

if(!empty($where))
{
$query .= " WHERE $where";
}


		if(!empty($limit))
{
$query .= " LIMIT $limit";

		if(!empty($limit))
{
$query .= " LIMIT $limit";

Zeile 807Zeile 818
		return $this->write_query("
UPDATE {$this->table_prefix}$table
SET $query

		return $this->write_query("
UPDATE {$this->table_prefix}$table
SET $query

		");

		");

	}

/**

	}

/**

Zeile 824Zeile 835
		if(!empty($where))
{
$query .= " WHERE $where";

		if(!empty($where))
{
$query .= " WHERE $where";

		}


		}


		if(!empty($limit))
{
$query .= " LIMIT $limit";

		if(!empty($limit))
{
$query .= " LIMIT $limit";

Zeile 847Zeile 858
	 */
function escape_string($string)
{

	 */
function escape_string($string)
{

 
		if($this->db_encoding == 'utf8')
{
$string = validate_utf8_string($string, false);
}
elseif($this->db_encoding == 'utf8mb4')
{
$string = validate_utf8_string($string);
}


		if(function_exists("mysql_real_escape_string") && $this->read_link)
{
$string = mysql_real_escape_string($string, $this->read_link);

		if(function_exists("mysql_real_escape_string") && $this->read_link)
{
$string = mysql_real_escape_string($string, $this->read_link);

		}
else
{

		}
else
{

			$string = addslashes($string);
}
return $string;

			$string = addslashes($string);
}
return $string;

Zeile 878Zeile 898
	function escape_string_like($string)
{
return $this->escape_string(str_replace(array('%', '_') , array('\\%' , '\\_') , $string));

	function escape_string_like($string)
{
return $this->escape_string(str_replace(array('%', '_') , array('\\%' , '\\_') , $string));

	}


	}


	/**
* Gets the current version of MySQL.
*

	/**
* Gets the current version of MySQL.
*

Zeile 888Zeile 908
	function get_version()
{
if($this->version)

	function get_version()
{
if($this->version)

		{

		{

			return $this->version;
}
$query = $this->query("SELECT VERSION() as version");

			return $this->version;
}
$query = $this->query("SELECT VERSION() as version");

Zeile 923Zeile 943

/**
* Show the "create table" command for a specific table.


/**
* Show the "create table" command for a specific table.

	 *
* @param string The name of the table.

	 *
* @param string The name of the table.

	 * @return string The MySQL command to create the specified table.
*/
function show_create_table($table)

	 * @return string The MySQL command to create the specified table.
*/
function show_create_table($table)

Zeile 932Zeile 952
		$query = $this->write_query("SHOW CREATE TABLE {$this->table_prefix}{$table}");
$structure = $this->fetch_array($query);
return $structure['Create Table'];

		$query = $this->write_query("SHOW CREATE TABLE {$this->table_prefix}{$table}");
$structure = $this->fetch_array($query);
return $structure['Create Table'];

	}


	}


	/**
* Show the "show fields from" command for a specific table.
*

	/**
* Show the "show fields from" command for a specific table.
*

Zeile 998Zeile 1018
		{
$table_type = my_strtoupper($status['Type']);
}

		{
$table_type = my_strtoupper($status['Type']);
}

		if($version >= '3.23.23' && $table_type == 'MYISAM')





		if(version_compare($version, '3.23.23', '>=') && ($table_type == 'MYISAM' || $table_type == 'ARIA'))
{
return true;
}
elseif(version_compare($version, '5.6', '>=') && $table_type == 'INNODB')

		{
return true;
}

		{
return true;
}

Zeile 1042Zeile 1066
	{
$version = $this->get_version();
$supports_fulltext = $this->supports_fulltext($table);

	{
$version = $this->get_version();
$supports_fulltext = $this->supports_fulltext($table);

		if($version >= '4.0.1' && $supports_fulltext == true)

		if(version_compare($version, '4.0.1', '>=') && $supports_fulltext == true)

		{
return true;
}

		{
return true;
}

Zeile 1246Zeile 1270
			'latin5' => 'ISO 8859-9 Turkish',
'armscii8' => 'ARMSCII-8 Armenian',
'utf8' => 'UTF-8 Unicode',

			'latin5' => 'ISO 8859-9 Turkish',
'armscii8' => 'ARMSCII-8 Armenian',
'utf8' => 'UTF-8 Unicode',

 
			'utf8mb4' => '4-Byte UTF-8 Unicode (requires MySQL 5.5.3 or above)',

			'ucs2' => 'UCS-2 Unicode',
'cp866' => 'DOS Russian',
'keybcs2' => 'DOS Kamenicky Czech-Slovak',

			'ucs2' => 'UCS-2 Unicode',
'cp866' => 'DOS Russian',
'keybcs2' => 'DOS Kamenicky Czech-Slovak',

Zeile 1294Zeile 1319
			'latin5' => 'latin5_turkish_ci',
'armscii8' => 'armscii8_general_ci',
'utf8' => 'utf8_general_ci',

			'latin5' => 'latin5_turkish_ci',
'armscii8' => 'armscii8_general_ci',
'utf8' => 'utf8_general_ci',

 
			'utf8mb4' => 'utf8mb4_general_ci',

			'ucs2' => 'ucs2_general_ci',
'cp866' => 'cp866_general_ci',
'keybcs2' => 'keybcs2_general_ci',

			'ucs2' => 'ucs2_general_ci',
'cp866' => 'cp866_general_ci',
'keybcs2' => 'keybcs2_general_ci',