PreparedStatementCommon Class Reference

Inherited by MSSQLPreparedStatement, MySQLPreparedStatement, OCI8PreparedStatement, PgSQLPreparedStatement, and SQLitePreparedStatement.

List of all members.

Public Member Functions

Protected Member Functions

Protected Attributes


Member Function Documentation

PreparedStatementCommon::__construct ( Connection $conn, $sql )

 

Create new prepared statement instance.

Parameters
object $conn Connection object
string $sql The SQL to work with.
array $positions The positions in SQL of ?'s.
restult $stmt If the driver supports prepared queries, then $stmt will contain the statement to use.

Reimplemented in MSSQLCallableStatement.

PreparedStatementCommon::setLimit ( $v )

 

See also PreparedStatement::setLimit()

PreparedStatementCommon::getLimit ( )

 

See also PreparedStatement::getLimit()

PreparedStatementCommon::setOffset ( $v )

 

See also PreparedStatement::setOffset()

PreparedStatementCommon::getOffset ( )

 

See also PreparedStatement::getOffset()

PreparedStatementCommon::getResultSet ( )

 

See also PreparedStatement::getResultSet()

PreparedStatementCommon::getUpdateCount ( )

 

See also PreparedStatement::getUpdateCount()

PreparedStatementCommon::getMoreResults ( )

 

See also PreparedStatement::getMoreResults()

Reimplemented in MSSQLCallableStatement.

PreparedStatementCommon::getConnection ( )

 

See also PreparedStatement::getConnection()

null PreparedStatementCommon::getResource ( )

 

Statement resources do not exist for emulated prepared statements, so this just returns null.
Returns null

Reimplemented in MSSQLCallableStatement.

PreparedStatementCommon::close ( )

 

Nothing to close for emulated prepared statements.

Reimplemented in MSSQLCallableStatement, and OCI8PreparedStatement.

string PreparedStatementCommon::replaceParams ( ) [protected]

 

Replaces placeholders with the specified parameter values in the SQL.

This is for emulated prepared statements.

Returns string New SQL statement with parameters replaced.
Exceptions
SQLException - if param not bound.

ResultSet PreparedStatementCommon::executeQuery ( $p1 = null, $fetchmode = null )

 

Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query. We support two signatures for this method:

Reimplemented in MSSQLCallableStatement, MSSQLPreparedStatement, and OCI8PreparedStatement.

int PreparedStatementCommon::executeUpdate ( $params = null )

 

Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.

Parameters
array $params Parameters that will be set using PreparedStatement::set() before query is executed.

Returns int Number of affected rows (or 0 for drivers that return nothing).
Exceptions
SQLException if a database access error occurs.

Reimplemented in OCI8PreparedStatement.

string PreparedStatementCommon::escape ( $ str ) [protected, pure virtual]

 

Escapes special characters (usu. quotes) using native driver function.
Parameters
string $str The input string.

Returns string The escaped string.

Implemented in MSSQLPreparedStatement, MySQLPreparedStatement, OCI8PreparedStatement, PgSQLPreparedStatement, and SQLitePreparedStatement.

void PreparedStatementCommon::set ( $paramIndex, $value )

 

A generic set method.

You can use this if you don't want to concern yourself with the details. It involves slightly more overhead than the specific settesr, since it grabs the PHP type to determine which method makes most sense.

Parameters
int $paramIndex
mixed $value

Returns void
Exceptions
SQLException 

void PreparedStatementCommon::setArray ( $paramIndex, $value )

 

Sets an array. Unless a driver-specific method is used, this means simply serializing the passed parameter and storing it as a string.
Parameters
int $paramIndex
array $value

Returns void

Reimplemented in PgSQLPreparedStatement.

void PreparedStatementCommon::setBoolean ( $paramIndex, $value )

 

Sets a boolean value. Default behavior is true = 1, false = 0.
Parameters
int $paramIndex
boolean $value

Returns void

Reimplemented in PgSQLPreparedStatement.

PreparedStatementCommon::setBlob ( $paramIndex, $blob )

 

See also PreparedStatement::setBlob()

Reimplemented in MSSQLPreparedStatement, OCI8PreparedStatement, PgSQLPreparedStatement, and SQLitePreparedStatement.

PreparedStatementCommon::setClob ( $paramIndex, $clob )

 

See also PreparedStatement::setClob()

Reimplemented in OCI8PreparedStatement.

void PreparedStatementCommon::setDate ( $paramIndex, $value )

 

Parameters
int $paramIndex
string $value

Returns void

void PreparedStatementCommon::setDecimal ( $paramIndex, $value )

 

Parameters
int $paramIndex
double $value

Returns void

void PreparedStatementCommon::setDouble ( $paramIndex, $value )

 

Parameters
int $paramIndex
double $value

Returns void

void PreparedStatementCommon::setFloat ( $paramIndex, $value )

 

Parameters
int $paramIndex
float $value

Returns void

void PreparedStatementCommon::setInt ( $paramIndex, $value )

 

Parameters
int $paramIndex
int $value

Returns void

PreparedStatementCommon::setInteger ( $paramIndex, $value )

 

Alias for setInt()
Parameters
int $paramIndex
int $value

void PreparedStatementCommon::setNull ( $paramIndex )

 

Parameters
int $paramIndex

Returns void

Reimplemented in MSSQLCallableStatement.

void PreparedStatementCommon::setString ( $paramIndex, $value )

 

Parameters
int $paramIndex
string $value

Returns void

void PreparedStatementCommon::setTime ( $paramIndex, $value )

 

Parameters
int $paramIndex
string $value

Returns void

void PreparedStatementCommon::setTimestamp ( $paramIndex, $value )

 

Parameters
int $paramIndex
string $value

Returns void


Member Data Documentation

PreparedStatementCommon::$conn [protected]

 

PreparedStatementCommon::$limit = 0 [protected]

 

PreparedStatementCommon::$offset = 0 [protected]

 

PreparedStatementCommon::$sql [protected]

 

PreparedStatementCommon::$positions [protected]

 

PreparedStatementCommon::$positionsCount [protected]

 

PreparedStatementCommon::$boundInVars = array() [protected]

 

PreparedStatementCommon::$resultSet [protected]

 

PreparedStatementCommon::$updateCount [protected]

 


This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS