Vergleich inc/db_mysqli.php - 1.8.9 - 1.8.20

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1050Zeile 1050
			return $this->version;
}


			return $this->version;
}


		$version = @mysqli_get_server_info($this->read_link);
if(!$version)
{
$query = $this->query("SELECT VERSION() as version");
$ver = $this->fetch_array($query);
$version = $ver['version'];
}

		$query = $this->query("SELECT VERSION() as version");
$ver = $this->fetch_array($query);
$version = $ver['version'];






if($version)
{


if($version)
{

Zeile 1132Zeile 1128
			if(preg_match("#FULLTEXT KEY (`?)$index(`?)#i", $structure))
{
return true;

			if(preg_match("#FULLTEXT KEY (`?)$index(`?)#i", $structure))
{
return true;

			}
else
{

			}
else
{

				return false;
}
}

				return false;
}
}

Zeile 1212Zeile 1208
		}

return false;

		}

return false;

	}


	}


	/**
* Creates a fulltext index on the specified column in the specified table with optional index name.

	/**
* Creates a fulltext index on the specified column in the specified table with optional index name.

	 *

	 *

	 * @param string $table The name of the table.
* @param string $column Name of the column to be indexed.
* @param string $name The index name, optional.

	 * @param string $table The name of the table.
* @param string $column Name of the column to be indexed.
* @param string $name The index name, optional.

	 */

	 */

	function create_fulltext_index($table, $column, $name="")
{
$this->write_query("ALTER TABLE {$this->table_prefix}$table ADD FULLTEXT $name ($column)");

	function create_fulltext_index($table, $column, $name="")
{
$this->write_query("ALTER TABLE {$this->table_prefix}$table ADD FULLTEXT $name ($column)");

	}

	}


/**
* Drop an index with the specified name from the specified table


/**
* Drop an index with the specified name from the specified table

	 *

	 *

	 * @param string $table The name of the table.
* @param string $name The name of the index.
*/

	 * @param string $table The name of the table.
* @param string $name The name of the index.
*/

Zeile 1245Zeile 1241
	 * @param boolean $table_prefix use table prefix
*/
function drop_table($table, $hard=false, $table_prefix=true)

	 * @param boolean $table_prefix use table prefix
*/
function drop_table($table, $hard=false, $table_prefix=true)

	{
if($table_prefix == false)
{
$table_prefix = "";
}
else
{
$table_prefix = $this->table_prefix;
}

	{
if($table_prefix == false)
{
$table_prefix = "";
}
else
{
$table_prefix = $this->table_prefix;
}


if($hard == false)
{


if($hard == false)
{

Zeile 1292Zeile 1288
	 *
* @param string $table The table
* @param array $replacements The replacements

	 *
* @param string $table The table
* @param array $replacements The replacements

 
	 * @param string|array $default_field The default field(s)
* @param boolean $insert_id Whether or not to return an insert id. True by default

	 * @return mysqli_result|bool
*/

	 * @return mysqli_result|bool
*/

	function replace_query($table, $replacements=array())

	function replace_query($table, $replacements=array(), $default_field="", $insert_id=true)

	{
global $mybb;


	{
global $mybb;


Zeile 1329Zeile 1327

/**
* Drops a column


/**
* Drops a column

	 *
* @param string $table The table
* @param string $column The column name
* @return mysqli_result
*/

	 *
* @param string $table The table
* @param string $column The column name
* @return mysqli_result
*/

	function drop_column($table, $column)

	function drop_column($table, $column)

	{
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} DROP {$column}");
}

/**



	{
$column = trim($column, '`');

return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} DROP `{$column}`");
}

/**

	 * Adds a column
*
* @param string $table The table

	 * Adds a column
*
* @param string $table The table

Zeile 1348Zeile 1348
	 * @return mysqli_result
*/
function add_column($table, $column, $definition)

	 * @return mysqli_result
*/
function add_column($table, $column, $definition)

	{
return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ADD {$column} {$definition}");
}



	{
$column = trim($column, '`');

return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} ADD `{$column}` {$definition}");
}


/**
* Modifies a column


/**
* Modifies a column

	 *
* @param string $table The table

	 *
* @param string $table The table

	 * @param string $column The column name
* @param string $new_definition the new column definition
* @return mysqli_result
*/
function modify_column($table, $column, $new_definition)
{

	 * @param string $column The column name
* @param string $new_definition the new column definition
* @return mysqli_result
*/
function modify_column($table, $column, $new_definition)
{

		return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY {$column} {$new_definition}");



		$column = trim($column, '`');

return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} MODIFY `{$column}` {$new_definition}");

	}

/**

	}

/**

Zeile 1376Zeile 1380
	 */
function rename_column($table, $old_column, $new_column, $new_definition)
{

	 */
function rename_column($table, $old_column, $new_column, $new_definition)
{

		return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} CHANGE {$old_column} {$new_column} {$new_definition}");




		$old_column = trim($old_column, '`');
$new_column = trim($new_column, '`');

return $this->write_query("ALTER TABLE {$this->table_prefix}{$table} CHANGE `{$old_column}` `{$new_column}` {$new_definition}");

	}

/**

	}

/**