Class Zend_Db_Adapter_Mysqli

Description
  • license: New BSD License
  • copyright: Copyright (c) 2006 Zend Technologies USA Inc. (http://www.zend.com)

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


	
			
Variable Summary
 array $_config
 mixed $_profiler
Method Summary
 void commit ()
 int delete (string $table, string $where)
 array describeTable ( $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)
 integer lastInsertId ([string $tableName = null], [string $primaryKey = null])
 string limit ( $sql,  $count,  $offset)
 array listTables ()
 Zend_Db_Statement_Mysqli prepare (string $sql)
 PDOStatement query (string $sql, [array $bind = array()])
 mixed quote (mixed $value)
 string quoteIdentifier (string $ident)
 mixed quoteInto ( $text,  $value, string $txt, mixed $val)
 void rollBack ()
 Zend_Db_Select select ()
 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 81)

User-provided configuration.

Basic keys are:

host => (string) What host to connect to (default 127.0.0.1) port => (integer) Port number of MySQL server listens on socket => (string) Socket or named pipe that should be used database => (string) The name of the database to user username => (string) Connect to the database as this username. password => (string) Password associated with the username.

  • access: protected
  • todo: fix inconsistency between "database" used here and "dbname" use elsewhere
int $_fetchMode = Zend_Db::FETCH_ASSOC (line 100)

Fetch mode.

  • access: protected
mixed $_profiler (line 93)

Query profiler.

  • access: protected
Methods
beginTransaction (line 244)

Leave autocommit mode and begin a transaction.

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

Commit a transaction and return to autocommit mode.

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

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 222)

Returns the column descriptions for a table.

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

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 429)

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 451)

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 492)

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 473)

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 508)

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 394)

Get the fetch mode.

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

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 199)

Gets the last inserted ID.

  • access: public
integer lastInsertId ([string $tableName = null], [string $primaryKey = null])
  • string $tableName: not used in this adapter
  • string $primaryKey: not used in this adapter
limit (line 586)

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

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

Returns a list of the tables in the database.

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

Returns an SQL statement for preparation.

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

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 526)

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 574)

Quotes an identifier.

  • return: The quoted identifier.
  • access: public
  • todo: Quoting in this function does not work for versions older than 4.1.x: http://dev.mysql.com/doc/refman/4.1/en/legal-names.html
  • todo: filter according to *all* of the rules in: http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
  • todo: this function is an exact duplicate of the one in Pdo/Mysql.php
string quoteIdentifier (string $ident)
  • string $ident: The identifier.
quoteInto (line 557)

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 ( $text,  $value, string $txt, mixed $val)
  • string $txt: The text with a placeholder.
  • mixed $val: The value to quote.
  • $text
  • $value
rollBack (line 274)

Roll back a transaction and return to autocommit mode.

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

Creates and returns a new Zend_Db_Select object for this adapter.

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

Set the fetch mode.

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

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 108)

Creates a connection resource.

  • access: protected
void _connect ()

Documentation generated on Tue, 11 Jul 2006 12:24:20 -0500 by phpDocumentor 1.3.0RC6