Vergleich inc/db_base.php - 1.8.5 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 8Zeile 8
 *
*/


 *
*/


 
/**
* @property string title The title of the database access layer.
* @property string short_title The short title of the database access layer.
* @property string type The type of db software being used.
* @property int query_count A count of the number of queries.
* @property array querylist A list of the performed queries.
* @property float query_time The time spent performing queries.
* @property string engine The engine used to run the SQL database.
* @property bool can_search Whether or not this engine can use the search functionality.
*/

interface DB_Base
{
/**
* Connect to the database server.
*
* @param array $config Array of DBMS connection details.

interface DB_Base
{
/**
* Connect to the database server.
*
* @param array $config Array of DBMS connection details.

	 * @return resource The DB connection resource. Returns false on fail or -1 on a db connect failure.

	 * @return resource|PDOStatement|mysqli_result The DB connection resource. Returns false on fail or -1 on a db connect failure.

	 */
function connect($config);


	 */
function connect($config);


Zeile 22Zeile 32
	 * Query the database.
*
* @param string $string The query SQL.

	 * Query the database.
*
* @param string $string The query SQL.

	 * @param integer $hide_errors 1 if hide errors, 0 if not.

	 * @param integer|bool $hide_errors 1 if hide errors, 0 if not.

	 * @param integer 1 $write_query if executes on master database, 0 if not.

	 * @param integer 1 $write_query if executes on master database, 0 if not.

	 * @return resource The query data.

	 * @return resource|PDOStatement|mysqli_result The query data.

	 */
function query($string, $hide_errors=0, $write_query=0);


	 */
function query($string, $hide_errors=0, $write_query=0);


Zeile 33Zeile 43
	 *
* @param string $query The query SQL.
* @param boolean|int $hide_errors 1 if hide errors, 0 if not.

	 *
* @param string $query The query SQL.
* @param boolean|int $hide_errors 1 if hide errors, 0 if not.

	 * @return resource The query data.

	 * @return resource|PDOStatement|mysqli_result The query data.

	 */
function write_query($query, $hide_errors=0);


	 */
function write_query($query, $hide_errors=0);


Zeile 48Zeile 58
	/**
* Return a result array for a query.
*

	/**
* Return a result array for a query.
*

	 * @param resource	   $query	   The query ID.
* @param int $resulttype The type of array to return.

	 * @param resource|PDOStatement|mysqli_result $query The query ID.
* @param int $resulttype The type of array to return. Specified with the different constants for the type using

	 *
* @return array The array of results.
*/

	 *
* @return array The array of results.
*/

Zeile 58Zeile 68
	/**
* Return a specific field from a query.
*

	/**
* Return a specific field from a query.
*

	 * @param resource $query The query ID.

	 * @param resource|PDOStatement|mysqli_result $query The query ID.

	 * @param string $field The name of the field to return.
* @param int|boolean $row The number of the row to fetch it from.
*/

	 * @param string $field The name of the field to return.
* @param int|boolean $row The number of the row to fetch it from.
*/

Zeile 67Zeile 77
	/**
* Moves internal row pointer to the next row
*

	/**
* Moves internal row pointer to the next row
*

	 * @param resource $query The query ID.

	 * @param resource|PDOStatement|mysqli_result $query The query ID.

	 * @param int $row The pointer to move the row to.
*/
function data_seek($query, $row);

	 * @param int $row The pointer to move the row to.
*/
function data_seek($query, $row);

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

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

	 * @param resource $query The query ID.

	 * @param resource|PDOStatement|mysqli_result $query The query ID.

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

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

Zeile 124Zeile 134
	/**
* Return the number of fields.
*

	/**
* Return the number of fields.
*

	 * @param resource $query The query ID.

	 * @param resource|PDOStatement|mysqli_result $query The query ID.

	 * @return int The number of fields.
*/
function num_fields($query);

	 * @return int The number of fields.
*/
function num_fields($query);

Zeile 158Zeile 168
	/**
* Add a shutdown query.
*

	/**
* Add a shutdown query.
*

	 * @param resource $query The query data.
* @param string|int $name An optional name for the query.

	 * @param resource|PDOStatement|mysqli_result $query The query data.
* @param string $name An optional name for the query.

	 */

	 */

	function shutdown_query($query, $name=0);

	function shutdown_query($query, $name='');


/**
* Performs a simple select query.


/**
* Performs a simple select query.

Zeile 170Zeile 180
	 * @param string $fields Comma delimited list of fields to be selected.
* @param string $conditions SQL formatted list of conditions to be matched.
* @param array $options List of options: group by, order by, order direction, limit, limit start.

	 * @param string $fields Comma delimited list of fields to be selected.
* @param string $conditions SQL formatted list of conditions to be matched.
* @param array $options List of options: group by, order by, order direction, limit, limit start.

	 * @return resource The query data.

	 * @return resource|PDOStatement|mysqli_result The query data.

	 */
function simple_select($table, $fields="*", $conditions="", $options=array());


	 */
function simple_select($table, $fields="*", $conditions="", $options=array());


Zeile 188Zeile 198
	 *
* @param string $table The table name to perform the query on.
* @param array $array An array of inserts.

	 *
* @param string $table The table name to perform the query on.
* @param array $array An array of inserts.

	 * @return int The insert ID if available

	 * @return void

	 */
function insert_query_multiple($table, $array);


	 */
function insert_query_multiple($table, $array);


Zeile 200Zeile 210
	 * @param string $where An optional where clause for the query.
* @param string $limit An optional limit clause for the query.
* @param boolean $no_quote An option to quote incoming values of the array.

	 * @param string $where An optional where clause for the query.
* @param string $limit An optional limit clause for the query.
* @param boolean $no_quote An option to quote incoming values of the array.

	 * @return resource The query data.

	 * @return resource|PDOStatement|mysqli_result The query data.

	 */
function update_query($table, $array, $where="", $limit="", $no_quote=false);


	 */
function update_query($table, $array, $where="", $limit="", $no_quote=false);


Zeile 210Zeile 220
	 * @param string $table The table name to perform the query on.
* @param string $where An optional where clause for the query.
* @param string $limit An optional limit clause for the query.

	 * @param string $table The table name to perform the query on.
* @param string $where An optional where clause for the query.
* @param string $limit An optional limit clause for the query.

	 * @return resource The query data.

	 * @return resource|PDOStatement|mysqli_result The query data.

	 */
function delete_query($table, $where="", $limit="");


	 */
function delete_query($table, $where="", $limit="");


Zeile 223Zeile 233
	function escape_string($string);

/**

	function escape_string($string);

/**

	 * Frees the resources of a MySQLi query.

	 * Frees the resources of a query.

	 *

	 *

	 * @param object $query The query to destroy.

	 * @param resource|PDOStatement|mysqli_result $query The query to destroy.

	 * @return boolean Returns true on success, false on faliure
*/
function free_result($query);

	 * @return boolean Returns true on success, false on faliure
*/
function free_result($query);

Zeile 263Zeile 273
	 * Show the "create table" command for a specific table.
*
* @param string $table The name of the table.

	 * Show the "create table" command for a specific table.
*
* @param string $table The name of the table.

	 * @return string The MySQL command to create the specified table.

	 * @return string The SQL command to create the specified table.

	 */
function show_create_table($table);


	 */
function show_create_table($table);


Zeile 271Zeile 281
	 * Show the "show fields from" command for a specific table.
*
* @param string $table The name of the table.

	 * Show the "show fields from" command for a specific table.
*
* @param string $table The name of the table.

	 * @return string Field info for that table

	 * @return array Field info for that table

	 */
function show_fields_from($table);


	 */
function show_fields_from($table);


Zeile 348Zeile 358
	 *
* @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

	 */

	 */

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

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


/**
* Drops a column


/**
* Drops a column

Zeile 373Zeile 385
	 *
* @param string $table The table
* @param string $column The column name

	 *
* @param string $table The table
* @param string $column The column name

	 * @param string $new_definition The new column definition




	 * @param string $new_definition the new column definition
* @param boolean|string $new_not_null Whether to "drop" or "set" the NOT NULL attribute (no change if false)
* @param boolean|string $new_default_value The new default value, or false to drop the attribute
* @return bool Returns true if all queries are executed successfully or false if one of them failed

	 */

	 */

	function modify_column($table, $column, $new_definition);

	function modify_column($table, $column, $new_definition, $new_not_null=false, $new_default_value=false);


/**
* Renames a column
*
* @param string $table The table
* @param string $old_column The old column name


/**
* Renames a column
*
* @param string $table The table
* @param string $old_column The old column name

	 * @param string $new_column The new column name
* @param string $new_definition The new column definition




	 * @param string $new_column the new column name
* @param string $new_definition the new column definition
* @param boolean|string $new_not_null Whether to "drop" or "set" the NOT NULL attribute (no change if false)
* @param boolean|string $new_default_value The new default value, or false to drop the attribute
* @return bool Returns true if all queries are executed successfully

	 */

	 */

	function rename_column($table, $old_column, $new_column, $new_definition);

	function rename_column($table, $old_column, $new_column, $new_definition, $new_not_null=false, $new_default_value=false);


/**
* Sets the table prefix used by the simple select, insert, update and delete functions


/**
* Sets the table prefix used by the simple select, insert, update and delete functions

Zeile 405Zeile 423
	/**
* Fetch a list of database character sets this DBMS supports
*

	/**
* Fetch a list of database character sets this DBMS supports
*

	 * @return array Array of supported character sets with array key being the name, array value being display name. False if unsupported

	 * @return array|bool Array of supported character sets with array key being the name, array value being display name. False if unsupported

	 */
function fetch_db_charsets();


	 */
function fetch_db_charsets();


Zeile 413Zeile 431
	 * Fetch a database collation for a particular database character set
*
* @param string $charset The database character set

	 * Fetch a database collation for a particular database character set
*
* @param string $charset The database character set

	 * @return string The matching database collation, false if unsupported

	 * @return string|bool The matching database collation, false if unsupported

	 */
function fetch_charset_collation($charset);


	 */
function fetch_charset_collation($charset);