Class Zend_Db_Adapter_Mysqli

Description

Implements interfaces:

  • license: Zend
  • copyright: Copyright (c) 2005-2006 Zend Technologies Inc. (http://www.zend.com)

Located in /library/Zend/Db/Adapter/Mysqli.php (line 62)


	
			
Variable Summary
 array $_config
 mixed $_profiler
Method Summary
 void commit ()
 int delete (string $table, string $where)
 array describeTable (mixed $table)
 array fetchAll (string $sql, [array $bind = null])
 string fetchAssoc (string $sql, [array $bind = null])
 array fetchCol (string $sql, [array $bind = null])
 string fetchOne (string $sql, [array $bind = null])
 string fetchPairs (string $sql, [array $bind = null])
 array fetchRow (string $sql, [array $bind = null])
 int getFetchMode ()
 int insert (string $table, array $bind)
 int lastInsertId ([mixed $name = null])
 string limit (mixed $sql, mixed $count, mixed $offset)
 array listTables ()
 PDOStatement query (string $sql, [array $bind = array()])
 mixed quote (mixed $value)
 string quoteIdentifier (string $ident)
 mixed quoteInto (mixed $text, mixed $value, string $txt, mixed $val)
 void rollBack ()
 void setFetchMode (int $mode)
 int update (string $table, array $bind, string $where)
 void _connect ()
Variables
array $_config = array(
'host' => '127.0.0.1',
'port' => null,
'socket' => null,
'database' => null,
'username' => null,
'password' => null,
)
(line 78)

User-provided configuration.

Basic keys are:

username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to (default 127.0.0.1) dbname => (string) The name of the database to user

Additional keys are processed as key-value pairs for a PDO DSN string.

  • access: protected
int $_fetchMode = Zend_Db::FETCH_ASSOC (line 97)

Fetch mode.

  • access: protected
mixed $_profiler (line 90)

Query profiler.

  • access: protected
Methods
beginTransaction (line 239)

Leave autocommit mode and begin a transaction.

  • access: public
void beginTransaction ()
commit (line 253)

Commit a transaction and return to autocommit mode.

  • access: public
void commit ()
delete (line 336)

Deletes table rows based on a WHERE clause.

  • return: The number of affected rows.
  • access: public
int delete (string $table, string $where)
  • string $table: The table to udpate.
  • string $where: DELETE WHERE clause.
describeTable (line 217)

Returns the column descriptions for a table.

  • access: public
array describeTable (mixed $table)
fetchAll (line 402)

Fetches all SQL result rows as a sequential array.

  • access: public
array fetchAll (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
fetchAssoc (line 424)

Fetches all SQL result rows as an associative array.

The first column is the key, the entire row array is the value.

  • access: public
string fetchAssoc (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
fetchCol (line 446)

Fetches the first column of all SQL result rows as an array.

The first column in each row is used as the array key.

  • access: public
array fetchCol (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
fetchOne (line 487)

Fetches the first column of the first row of the SQL result.

  • access: public
string fetchOne (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
fetchPairs (line 468)

Fetches all SQL result rows as an array of key-value pairs.

The first column is the key, the second column is the value.

  • access: public
string fetchPairs (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
fetchRow (line 503)

Fetches the first row of the SQL result.

  • access: public
array fetchRow (string $sql, [array $bind = null])
  • string $sql: An SQL SELECT statement.
  • array $bind: Data to bind into SELECT placeholders.
getFetchMode (line 389)

Get the fetch mode.

  • access: public
int getFetchMode ()
insert (line 286)

Inserts a table row with specified data.

  • return: The number of affected rows.
  • access: public
int insert (string $table, array $bind)
  • string $table: The table to insert data into.
  • array $bind: Column-value pairs.
lastInsertId (line 194)

Gets the last inserted ID.

  • access: public
int lastInsertId ([mixed $name = null])
limit (line 576)

Adds an adapter-specific LIMIT clause to the SELECT statement.

  • access: public
string limit (mixed $sql, mixed $count, mixed $offset)
listTables (line 206)

Returns a list of the tables in the database.

  • access: public
array listTables ()
prepare (line 180)

Returns an SQL statement for preparation.

  • access: public
Zend_Db_Statement_Mysqli prepare (string $sql)
  • string $sql: The SQL statement with placeholders.
query (line 150)

Executes an SQL statement with bound data.

  • access: public
PDOStatement query (string $sql, [array $bind = array()])
  • string $sql: The SQL statement with placeholders.
  • array $bind: An array of data to bind to the placeholders.
quote (line 521)

Safely quotes a value for an SQL statement.

If an array is passed as the value, the array values are quoted and then returned as a comma-separated string.

  • return: An SQL-safe quoted value (or string of separated values).
  • access: public
mixed quote (mixed $value)
  • mixed $value: The value to quote.
quoteIdentifier (line 564)

Quotes an identifier.

  • return: The quoted identifier.
  • access: public
string quoteIdentifier (string $ident)
  • string $ident: The identifier.
quoteInto (line 552)

Quotes a value and places into a piece of text at a placeholder.

The placeholder is a question-mark; all placeholders will be replaced with the quoted value. For example:

  1. $text = "WHERE date < ?";
  2. $date = "2005-01-02";
  3. $safe = $sql->quoteInto($text, $date);
  4. // $safe = "WHERE date < '2005-01-02'"

  • return: An SQL-safe quoted value placed into the orignal text.
  • access: public
mixed quoteInto (mixed $text, mixed $value, string $txt, mixed $val)
  • string $txt: The text with a placeholder.
  • mixed $val: The value to quote.
rollBack (line 269)

Roll back a transaction and return to autocommit mode.

  • access: public
void rollBack ()
select (line 353)

Creates and returns a new Zend_Db_Select object for this adapter.

  • access: public
Zend_Db_Select select ()
setFetchMode (line 368)

Set the fetch mode.

  • access: public
  • todo: Support FETCH_CLASS and FETCH_INTO.
void setFetchMode (int $mode)
  • int $mode: A fetch mode.
update (line 310)

Updates table rows with specified data based on a WHERE clause.

  • return: The number of affected rows.
  • access: public
int update (string $table, array $bind, string $where)
  • string $table: The table to udpate.
  • array $bind: Column-value pairs.
  • string $where: UPDATE WHERE clause.
_connect (line 105)

Creates a connection resource.

  • access: protected
void _connect ()

Documentation generated on Wed, 08 Mar 2006 04:53:42 -0800 by phpDocumentor 1.3.0RC4