[ Index ]

PHP Cross Reference of MyBB 1.8.37

title

Body

[close]

/inc/ -> db_sqlite.php (summary)

(no description)

File Size: 1592 lines (37 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 inc/db_pdo.php
 inc/class_error.php

Defines 1 class

DB_SQLite:: (56 methods):
  connect()
  query()
  explain_query()
  write_query()
  fetch_array()
  fetch_field()
  data_seek()
  close_cursors()
  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()
  quote_val()
  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()
  supports_fulltext_boolean()
  create_fulltext_index()
  drop_index()
  index_exists()
  drop_table()
  rename_table()
  replace_query()
  set_table_prefix()
  fetch_size()
  alter_table_parse()
  drop_column()
  add_column()
  modify_column()
  rename_column()
  fetch_db_charsets()
  fetch_charset_collation()
  build_create_table_collation()
  get_execution_time()
  escape_binary()
  unescape_binary()


Class: DB_SQLite  - X-Ref

MyBB 1.8
Copyright 2014 MyBB Group, All Rights Reserved

Website: http://www.mybb.com
License: http://www.mybb.com/about/license
connect($config)   X-Ref
Connect to the database server.
return: bool Returns false on failure, otherwise true
param: array $config Array of DBMS connection details.

query($string, $hide_errors=0, $write_query=0)   X-Ref
Query the database.
return: PDOStatement The query data.
param: string $string The query SQL.
param: boolean|int $hide_errors 1 if hide errors, 0 if not.
param: integer $write_query 1 if executes on master database, 0 if not.

explain_query($string, $qtime)   X-Ref
Explain a query on the database.
param: string $string The query SQL.
param: string $qtime The time it took to perform the query.

write_query($query, $hide_errors=0)   X-Ref
Execute a write query on the database
return: PDOStatement The query data.
param: string $query The query SQL.
param: boolean|int $hide_errors 1 if hide errors, 0 if not.

fetch_array($query, $resulttype=PDO::FETCH_BOTH)   X-Ref
Return a result array for a query.
return: array The array of results.
param: PDOStatement $query The result data.
param: int $resulttype One of PDO's constants: FETCH_ASSOC, FETCH_BOUND, FETCH_CLASS, FETCH_INTO, FETCH_LAZY, FETCH_NAMED, FETCH_NUM, FETCH_OBJ or FETCH_BOTH

fetch_field($query, $field, $row=false)   X-Ref
Return a specific field from a query.
return: mixed
param: PDOStatement $query The query ID.
param: string $field The name of the field to return.
param: int|bool $row The number of the row to fetch it from.

data_seek($query, $row)   X-Ref
Moves internal row pointer to the next row
param: PDOStatement $query The query ID.
param: int $row The pointer to move the row to.

close_cursors()   X-Ref
Closes cursors of registered queries.

num_rows($query)   X-Ref
Return the number of rows resulting from a query.
return: int The number of rows in the result.
param: PDOStatement $query The query data.

insert_id($name="")   X-Ref
Return the last id number of inserted data.
return: int The id number.
param: string $name

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

error_number($query=null)   X-Ref
Return an error number.
return: int The error number of the current error.
param: PDOStatement $query

error_string($query=null)   X-Ref
Return an error string.
return: string The explanation for the current error.
param: PDOStatement $query

error($string="", $query=null, $error="", $error_no=0)   X-Ref
Output a database error.
param: string $string The string to present as an error.
param: PDOStatement $query
param: string $error
param: int $error_no

affected_rows($query=null)   X-Ref
Returns the number of affected rows in a query.
return: int The number of affected rows.
param: PDOStatement $query

num_fields($query)   X-Ref
Return the number of fields.
return: int The number of fields.
param: PDOStatement $query The query data.

list_tables($database, $prefix='')   X-Ref
Lists all tables in the database.
return: array The table list.
param: string $database The database name.
param: string $prefix Prefix of the table (optional)

table_exists($table)   X-Ref
Check if a table exists in a database.
return: boolean True when exists, false if not.
param: string $table The table name.

field_exists($field, $table)   X-Ref
Check if a field exists in a database.
return: boolean True when exists, false if not.
param: string $field The field name.
param: string $table The table name.

shutdown_query($query, $name="")   X-Ref
Add a shutdown query.
param: PDOStatement $query The query data.
param: string $name An optional name for the query.

simple_select($table, $fields="*", $conditions="", $options=array()   X-Ref
Performs a simple select query.
return: PDOStatement The query data.
param: string $table The table name to be queried.
param: string $fields Comma delimetered 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.

insert_query($table, $array)   X-Ref
Build an insert query from an array.
return: int|bool The insert ID if available or false if an error is found
param: string $table The table name to perform the query on.
param: array $array An array of fields and their values.

insert_query_multiple($table, $array)   X-Ref
Build one query for multiple inserts from a multidimensional array.
return: void
param: string $table The table name to perform the query on.
param: array $array An array of inserts.

update_query($table, $array, $where="", $limit="", $no_quote=false)   X-Ref
Build an update query from an array.
return: PDOStatement The query data.
param: string $table The table name to perform the query on.
param: array $array An array of fields and their values.
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.

quote_val($value, $quote="'")   X-Ref

return: int|string
param: int|string $value
param: string $quote

delete_query($table, $where="", $limit="")   X-Ref
Build a delete query.
return: PDOStatement The query data.
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.

escape_string($string)   X-Ref
Escape a string
return: string The escaped string.
param: string $string The string to be escaped.

free_result($query)   X-Ref
Serves no purposes except compatibility
return: boolean Returns true on success, false on failure
param: PDOStatement $query

escape_string_like($string)   X-Ref
Escape a string used within a like command.
return: string The escaped string.
param: string $string The string to be escaped.

get_version()   X-Ref
Gets the current version of SQLLite.
return: string Version of MySQL.

optimize_table($table)   X-Ref
Optimizes a specific table.
param: string $table The name of the table to be optimized.

analyze_table($table)   X-Ref
Analyzes a specific table.
param: string $table The name of the table to be analyzed.

show_create_table($table)   X-Ref
Show the "create table" command for a specific table.
return: string The SQLite command to create the specified table.
param: string $table The name of the table.

show_fields_from($table)   X-Ref
Show the "show fields from" command for a specific table.
return: array Field info for that table
param: string $table The name of the table.

is_fulltext($table, $index="")   X-Ref
Returns whether or not the table contains a fulltext index.
return: boolean True or false if the table has a fulltext index or not.
param: string $table The name of the table.
param: string $index Optionally specify the name of the index.

supports_fulltext($table)   X-Ref
Returns whether or not this database engine supports fulltext indexing.
return: boolean True or false if supported or not.
param: string $table The table to be checked.

supports_fulltext_boolean($table)   X-Ref
Returns whether or not this database engine supports boolean fulltext matching.
return: boolean True or false if supported or not.
param: string $table The table to be checked.

create_fulltext_index($table, $column, $name="")   X-Ref
Creates a fulltext index on the specified column in the specified table with optional index name.
return: bool
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.

drop_index($table, $name)   X-Ref
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.

index_exists($table, $index)   X-Ref
Checks to see if an index exists on a specified table
return: bool Returns whether index exists
param: string $table The name of the table.
param: string $index The name of the index.

drop_table($table, $hard=false, $table_prefix=true)   X-Ref
Drop an table with the specified table
param: string $table The name of the table.
param: boolean $hard hard drop - no checking
param: boolean $table_prefix use table prefix

rename_table($old_table, $new_table, $table_prefix=true)   X-Ref
Renames a table
return: PDOStatement
param: string $old_table The old table name
param: string $new_table the new table name
param: boolean $table_prefix use table prefix

replace_query($table, $replacements=array()   X-Ref
Replace contents of table with values
return: int|PDOStatement|bool Returns either the insert id (if a new row is inserted), the query resource (if a row is updated) or false on failure
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

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

fetch_size($table='')   X-Ref
Fetched the total size of all mysql tables or a specific table
return: integer the total size of all mysql tables or a specific table
param: string $table The table (optional) (ignored)

alter_table_parse($table, $alterdefs, $fullquery="")   X-Ref
Perform an "Alter Table" query in SQLite < 3.2.0 - Code taken from http://code.jenseng.com/db/
return: bool True on success, false on failure
param: string $table The table (optional)
param: string $alterdefs
param: string $fullquery

drop_column($table, $column)   X-Ref
Drops a column
return: PDOStatement
param: string $table The table
param: string $column The column name

add_column($table, $column, $definition)   X-Ref
Adds a column
return: PDOStatement
param: string $table The table
param: string $column The column name
param: string $definition the new column definition

modify_column($table, $column, $new_definition, $new_not_null=false, $new_default_value=false)   X-Ref
Modifies a column
return: bool Returns true if all queries are executed successfully or false if one of them failed
param: string $table The table
param: string $column The 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

rename_column($table, $old_column, $new_column, $new_definition, $new_not_null=false, $new_default_value=false)   X-Ref
Renames a column
return: bool Returns true if all queries are executed successfully
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: 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

fetch_db_charsets()   X-Ref
Fetch a list of database character sets this DBMS supports
return: array|bool 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
return: string|bool The matching database collation, false if unsupported
param: string $charset The database character set

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.

escape_binary($string)   X-Ref
Binary database fields require special attention.
return: string Encoded binary value
param: string $string Binary value

unescape_binary($string)   X-Ref
Unescape binary data.
return: string Encoded binary value
param: string $string Binary value



2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref