Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/DB/mysql.php
PEAR Repository -

DB_mysql

DB_common
   |
  +-- DB_mysql

DB_common is a base class for DB implementations, and should be
inherited by all such.

 

private class DB_mysql extends DB_common

DB_common is a base class for DB implementations, and should be
inherited by all such.

 

Methods inherited from DB_common

quotestring, provides, errorcode, errormessage, &raiseerror, seterrorhandling, setfetchmode, execute_emulate_query, executemultiple, &getone, &getrow, &getcol, &getassoc, &getall, tostring, db_common

Public Method Summary

void

DB_mysql()

DB_mysql constructor.
int

connect( &$dsn, boolean $persistent)

Connect to a database and log in as the specified user.
bool

disconnect()

Log out and disconnect from the database.
object [unknown]

&query( $query)

Send a query to MySQL and return the results as a DB_result object.
int

simpleQuery( $query)

Send a query to MySQL and return the results as a MySQL resource
mixed

&fetchRow(array $result, string $fetchmode)

Fetch a row and return as array.
int

fetchInto(array $result, array &$arr, string $fetchmode)

Fetch a row and insert the data into an existing array.
bool

freeResult( $result)

Free the internal resources associated with $result.
int

numCols( $result)

Get the number of columns in a result set.
int

errorNative()

Get the native error code of the last error (if any) that
int

prepare( $query)

Prepares a query for multiple execution with execute(). With
object [unknown]

autoCommit(boolean $onoff)

Enable/disable automatic commits [not supported by MySQL]
object [unknown]

commit()

Commit transactions on the current connection [not supported by MySQL]
object [unknown]

rollback()

Roll back all uncommitted transactions on the current connection.

Private Method Summary

int

execute( $stmt, boolean $data)

Executes a prepared query and substitutes placeholders with

Fields inherited from DB_common

$features, $errorcode_map, $type, $prepare_maxstmt, $error_mode, $error_level, $error_callback, $last_query, $fetchmode

Private Field Summary

unknown

$connection

unknown

$phptype

array

$prepare_tokens

array

$prepare_types

Public Method Details

DB_mysql

public void DB_mysql( )

  DB_mysql constructor.

Returns void


connect

public int connect( &$dsn, boolean $persistent )

  Connect to a database and log in as the specified user.

Parameter
&$dsn
boolean $persistent
Returns int

DB_OK on success, a DB error on failure


disconnect

public bool disconnect( )

  Log out and disconnect from the database.

Returns bool

TRUE on success, FALSE if not connected.


&query

public object [unknown] &query( $query )

  Send a query to MySQL and return the results as a DB_result object.

Parameter
$query
Returns object [unknown]

a DB_result object on success, a DB error
on failure


simpleQuery

public int simpleQuery( $query )

  Send a query to MySQL and return the results as a MySQL resource
identifier.

Parameter
$query
Returns int

returns a valid MySQL result for successful SELECT
queries, DB_OK for other successful queries. A DB error is
returned on failure.


&fetchRow

public mixed &fetchRow( array $result, string $fetchmode )

  Fetch a row and return as array.

Parameter
array $result
should be indexed
string $fetchmode
Returns mixed

an array on success, a DB error on failure, NULL
if there is no more data


fetchInto

public int fetchInto( array $result, array &$arr, string $fetchmode )

  Fetch a row and insert the data into an existing array.

Parameter
array $result
where data from the row is stored
array &$arr
data should be indexed
string $fetchmode
Returns int

DB_OK on success, a DB error on failure


freeResult

public bool freeResult( $result )

  Free the internal resources associated with $result.

Parameter
$result
Returns bool

TRUE on success, FALSE if $result is invalid


numCols

public int numCols( $result )

  Get the number of columns in a result set.

Parameter
$result
Returns int

the number of columns per row in $result


errorNative

public int errorNative( )

  Get the native error code of the last error (if any) that
occured on the current connection.

Returns int

native MySQL error code


prepare

public int prepare( $query )

  Prepares a query for multiple execution with execute(). With
MySQL, this is emulated.

Parameter
$query
Returns int

identifier for this prepared query


autoCommit

public object [unknown] autoCommit( boolean $onoff )

  Enable/disable automatic commits [not supported by MySQL]

Parameter
boolean $onoff
Returns object [unknown]

DB error code (not capable)


commit

public object [unknown] commit( )

  Commit transactions on the current connection [not supported by MySQL]

Returns object [unknown]

DB error code (not capable)


rollback

public object [unknown] rollback( )

  Roll back all uncommitted transactions on the current connection.
[not supported by MySQL]

Returns object [unknown]

DB error code (not capable)


Private Method Details

execute

private int execute( $stmt, boolean $data )

  Executes a prepared query and substitutes placeholders with
provided values.

Parameter
$stmt
boolean $data
Returns int

returns a MySQL result resource for successful
SELECT queries, DB_OK for other successful queries. A DB error
is returned on failure.

See Also D::D

Private Field Details

$connection

private unknown $connection

>>unknown<<


$phptype

private unknown $phptype

>>unknown<<


$prepare_tokens

private array $prepare_tokens

>>array()<<


$prepare_types

private array $prepare_types

>>array()<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta