[ Index ]

PHP Cross Reference of MyBB 1.8.28

title

Body

[close]

/inc/ -> db_pgsql.php (summary)

(no description)

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

Defines 1 class

DB_PgSQL:: (55 methods):
  connect()
  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()
  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()
  build_fields_string()
  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()
  escape_binary()
  unescape_binary()


Class: DB_PgSQL  - 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: resource The DB connection resource. Returns false on failure
param: array $config Array of DBMS connection details.

query($string, $hide_errors=0, $write_query=0)   X-Ref
Query the database.
return: resource 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 slave database, 0 if not.

write_query($query, $hide_errors=0)   X-Ref
Execute a write query on the slave database
return: resource The query data.
param: string $query The query SQL.
param: boolean|int $hide_errors 1 if hide errors, 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.

fetch_array($query, $resulttype=PGSQL_ASSOC)   X-Ref
Return a result array for a query.
return: array The array of results. Note that all fields are returned as string: http://php.net/manual/en/function.pg-fetch-array.php
param: resource $query The query ID.
param: int $resulttype The type of array to return. Either PGSQL_NUM, PGSQL_BOTH or PGSQL_ASSOC

fetch_field($query, $field, $row=false)   X-Ref
Return a specific field from a query.
return: string|bool|null As per http://php.net/manual/en/function.pg-fetch-result.php
param: resource $query The query ID.
param: string $field The name of the field to return.
param: int|bool The number of the row to fetch it from.

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

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

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($query=null)   X-Ref
Return an error number.
return: int The error number of the current error.
param: resource $query

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

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

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.
return: int The number of fields.
param: resource $query The query ID.

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: resource $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: resource 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, $insert_id=true)   X-Ref
Build an insert query from an array.
return: int|bool The insert ID if available. False on failure and true if $insert_id is false
param: string $table The table name to perform the query on.
param: array $array An array of fields and their values.
param: boolean $insert_id Whether or not to return an insert id. True by default

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: resource 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: resource 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 according to the pg escape format.
return: string The escaped string.
param: string $string The string to be escaped.

free_result($query)   X-Ref
Frees the resources of a PgSQL query.
return: boolean Returns true on success, false on failure
param: resource $query The query to destroy.

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 PgSQL.
return: string Version of PgSQL.

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 pg 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: resource
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|resource|bool Returns either the insert id (if a new row is inserted and $insert_id is true), a boolean (if $insert_id is wrong) or the query resource (if a row is updated)
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

build_fields_string($table, $append="")   X-Ref

return: string
param: string $table
param: string $append

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

add_column($table, $column, $definition)   X-Ref
Adds a column
return: resource
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

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)

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