[ Index ]

PHP Cross Reference of MyBB

title

Body

[close]

/inc/ -> db_mysql.php (summary)

(no description)

File Size: 1368 lines (32 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 inc/class_error.php

Defines 1 class

DB_MySQL:: (51 methods):
  connect()
  select_db()
  query()
  write_query()
  explain_query()
  fetch_array()
  fetch_field()
  data_seek()
  num_rows()
  insert_id()
  close()
  error_number()
  error_string()
  error()
  affected_rows()
  num_fields()
  list_tables()
  table_exists()
  field_exists()
  shutdown_query()
  simple_select()
  insert_query()
  insert_query_multiple()
  update_query()
  delete_query()
  escape_string()
  free_result()
  escape_string_like()
  get_version()
  optimize_table()
  analyze_table()
  show_create_table()
  show_fields_from()
  is_fulltext()
  supports_fulltext()
  index_exists()
  supports_fulltext_boolean()
  create_fulltext_index()
  drop_index()
  drop_table()
  replace_query()
  drop_column()
  add_column()
  modify_column()
  rename_column()
  set_table_prefix()
  fetch_size()
  fetch_db_charsets()
  fetch_charset_collation()
  build_create_table_collation()
  get_execution_time()


Class: DB_MySQL  - X-Ref

MyBB 1.6
Copyright 2010 MyBB Group, All Rights Reserved

Website: http://mybb.com
License: http://mybb.com/about/license

$Id$
connect($config)   X-Ref
Connect to the database server.

param: array Array of DBMS connection details.
return: resource The DB connection resource. Returns false on fail or -1 on a db connect failure.

select_db($database)   X-Ref
Selects the database to use.

param: string The database name.
return: boolean True when successfully connected, false if not.

query($string, $hide_errors=0, $write_query=0)   X-Ref
Query the database.

param: string The query SQL.
param: integer 1 if hide errors, 0 if not.
param: integer 1 if executes on slave database, 0 if not.
return: resource The query data.

write_query($query, $hide_errors=0)   X-Ref
Execute a write query on the slave database

param: string The query SQL.
param: boolean 1 if hide errors, 0 if not.
return: resource The query data.

explain_query($string, $qtime)   X-Ref
Explain a query on the database.

param: string The query SQL.
param: string The time it took to perform the query.

fetch_array($query)   X-Ref
Return a result array for a query.

param: resource The query ID.
param: constant The type of array to return.
return: array The array of results.

fetch_field($query, $field, $row=false)   X-Ref
Return a specific field from a query.

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.

data_seek($query, $row)   X-Ref
Moves internal row pointer to the next row

param: resource The query ID.
param: int The pointer to move the row to.

num_rows($query)   X-Ref
Return the number of rows resulting from a query.

param: resource The query ID.
return: int The number of rows in the result.

insert_id()   X-Ref
Return the last id number of inserted data.

return: int The id number.

close()   X-Ref
Close the connection with the DBMS.


error_number()   X-Ref
Return an error number.

return: int The error number of the current error.

error_string()   X-Ref
Return an error string.

return: string The explanation for the current error.

error($string="")   X-Ref
Output a database error.

param: string The string to present as an error.

affected_rows()   X-Ref
Returns the number of affected rows in a query.

return: int The number of affected rows.

num_fields($query)   X-Ref
Return the number of fields.

param: resource The query ID.
return: int The number of fields.

list_tables($database, $prefix='')   X-Ref
Lists all functions in the database.

param: string The database name.
param: string Prefix of the table (optional)
return: array The table list.

table_exists($table)   X-Ref
Check if a table exists in a database.

param: string The table name.
return: boolean True when exists, false if not.

field_exists($field, $table)   X-Ref
Check if a field exists in a database.

param: string The field name.
param: string The table name.
return: boolean True when exists, false if not.

shutdown_query($query, $name=0)   X-Ref
Add a shutdown query.

param: resource The query data.
param: string An optional name for the query.

simple_select($table, $fields="*", $conditions="", $options=array()   X-Ref
Performs a simple select query.

param: string The table name to be queried.
param: string Comma delimetered list of fields to be selected.
param: string SQL formatted list of conditions to be matched.
param: array List of options, order by, order direction, limit, limit start.
return: resource The query data.

insert_query($table, $array)   X-Ref
Build an insert query from an array.

param: string The table name to perform the query on.
param: array An array of fields and their values.
return: int The insert ID if available

insert_query_multiple($table, $array)   X-Ref
Build one query for multiple inserts from a multidimensional array.

param: string The table name to perform the query on.
param: array An array of inserts.
return: int The insert ID if available

update_query($table, $array, $where="", $limit="", $no_quote=false)   X-Ref
Build an update query from an array.

param: string The table name to perform the query on.
param: array An array of fields and their values.
param: string An optional where clause for the query.
param: string An optional limit clause for the query.
param: boolean An option to quote incoming values of the array.
return: resource The query data.

delete_query($table, $where="", $limit="")   X-Ref
Build a delete query.

param: string The table name to perform the query on.
param: string An optional where clause for the query.
param: string An optional limit clause for the query.
return: resource The query data.

escape_string($string)   X-Ref
Escape a string according to the MySQL escape format.

param: string The string to be escaped.
return: string The escaped string.

free_result($query)   X-Ref
Frees the resources of a MySQLi query.

param: object The query to destroy.
return: boolean Returns true on success, false on faliure

escape_string_like($string)   X-Ref
Escape a string used within a like command.

param: string The string to be escaped.
return: string The escaped string.

get_version()   X-Ref
Gets the current version of MySQL.

return: string Version of MySQL.

optimize_table($table)   X-Ref
Optimizes a specific table.

param: string The name of the table to be optimized.

analyze_table($table)   X-Ref
Analyzes a specific table.

param: string The name of the table to be analyzed.

show_create_table($table)   X-Ref
Show the "create table" command for a specific table.

param: string The name of the table.
return: string The MySQL command to create the specified table.

show_fields_from($table)   X-Ref
Show the "show fields from" command for a specific table.

param: string The name of the table.
return: string Field info for that table

is_fulltext($table, $index="")   X-Ref
Returns whether or not the table contains a fulltext index.

param: string The name of the table.
param: string Optionally specify the name of the index.
return: boolean True or false if the table has a fulltext index or not.

supports_fulltext($table)   X-Ref
Returns whether or not this database engine supports fulltext indexing.

param: string The table to be checked.
return: boolean True or false if supported or not.

index_exists($table, $index)   X-Ref
Checks to see if an index exists on a specified table

param: string The name of the table.
param: string The name of the index.

supports_fulltext_boolean($table)   X-Ref
Returns whether or not this database engine supports boolean fulltext matching.

param: string The table to be checked.
return: boolean True or false if supported or not.

create_fulltext_index($table, $column, $name="")   X-Ref
Creates a fulltext index on the specified column in the specified table with optional index name.

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

drop_index($table, $name)   X-Ref
Drop an index with the specified name from the specified table

param: string The name of the table.
param: string The name of the index.

drop_table($table, $hard=false, $table_prefix=true)   X-Ref
Drop an table with the specified table

param: boolean hard drop - no checking
param: boolean use table prefix

replace_query($table, $replacements=array()   X-Ref
Replace contents of table with values

param: string The table
param: array The replacements

drop_column($table, $column)   X-Ref
Drops a column

param: string The table
param: string The column name

add_column($table, $column, $definition)   X-Ref
Adds a column

param: string The table
param: string The column name
param: string the new column definition

modify_column($table, $column, $new_definition)   X-Ref
Modifies a column

param: string The table
param: string The column name
param: string the new column definition

rename_column($table, $old_column, $new_column, $new_definition)   X-Ref
Renames a column

param: string The table
param: string The old column name
param: string the new column name
param: string the new column definition

set_table_prefix($prefix)   X-Ref
Sets the table prefix used by the simple select, insert, update and delete functions

param: string The new table prefix

fetch_size($table='')   X-Ref
Fetched the total size of all mysql tables or a specific table

param: string The table (optional)
return: integer the total size of all mysql tables or a specific table

fetch_db_charsets()   X-Ref
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

fetch_charset_collation($charset)   X-Ref
Fetch a database collation for a particular database character set

param: string The database character set
return: string The matching database collation, false if unsupported

build_create_table_collation()   X-Ref
Fetch a character set/collation string for use with CREATE TABLE statements. Uses current DB encoding

return: string The built string, empty if unsupported

get_execution_time()   X-Ref
Time how long it takes for a particular piece of code to run. Place calls above & below the block of code.

return: float The time taken



Generated: Tue Oct 8 19:19:50 2013 Cross-referenced by PHPXref 0.7.1