PreparedStatementCommon Class Reference

Inherits PreparedStatement.

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

List of all members.

Public Member Functions

Public Attributes


Constructor & Destructor Documentation

PreparedStatementCommon::PreparedStatementCommon ( &$  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.


Member Function Documentation

PreparedStatementCommon::setLimit ( $  v)

 

See also PreparedStatement::setLimit()

Reimplemented from PreparedStatement.

PreparedStatementCommon::getLimit ()

 

See also PreparedStatement::getLimit()

Reimplemented from PreparedStatement.

PreparedStatementCommon::setOffset ( $  v)

 

See also PreparedStatement::setOffset()

Reimplemented from PreparedStatement.

PreparedStatementCommon::getOffset ()

 

See also PreparedStatement::getOffset()

Reimplemented from PreparedStatement.

& PreparedStatementCommon::getResultSet ()

 

See also PreparedStatement::getResultSet()

Reimplemented from PreparedStatement.

PreparedStatementCommon::getUpdateCount ()

 

See also PreparedStatement::getUpdateCount()

Reimplemented from PreparedStatement.

PreparedStatementCommon::getMoreResults ()

 

SQLite doesn't support multiple resultsets returned by single query, so this just returns false.

See also PreparedStatement::getConnection()

Reimplemented from PreparedStatement.

Reimplemented in MSSQLCallableStatement.

& PreparedStatementCommon::getConnection ()

 

See also PreparedStatement::getConnection()

Reimplemented from PreparedStatement.

PreparedStatementCommon::getResource ()

 

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

Returns null

Reimplemented from PreparedStatement.

Reimplemented in MSSQLCallableStatement.

PreparedStatementCommon::close ()

 

Nothing to close for emulated prepared statements.

Reimplemented from PreparedStatement.

Reimplemented in MSSQLCallableStatement, and OCI8PreparedStatement.

PreparedStatementCommon::replaceParams ()

 

Replaces placeholders with the specified parameter values in the SQL.

This is for emulated prepared statements.

Returns mixed New SQL statement with parameters replaced or SQLException - if param not bound.

& 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 from PreparedStatement.

Reimplemented in MSSQLCallableStatement, and MSSQLPreparedStatement.

& 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 from PreparedStatement.

PreparedStatementCommon::escape ( &$  str)

 

Escapes special characters (usu. quotes) using native driver function.

Parameters:
string $str The input string.

Returns string The escaped string.

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 mixed TRUE on success, SQLException on error.

Reimplemented from PreparedStatement.

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 from PreparedStatement.

Reimplemented in PgSQLPreparedStatement.

PreparedStatementCommon::setBoolean ( $  paramIndex,  $  value )

 

Sets a boolean value. Default behavior is true = 1, false = 0.

Parameters:
int $paramIndex
boolean $value

Returns void

Reimplemented from PreparedStatement.

Reimplemented in PgSQLPreparedStatement.

PreparedStatementCommon::setBlob ( $  paramIndex,  $  blob )

 

See also PreparedStatement::setBlob()

Reimplemented from PreparedStatement.

Reimplemented in MSSQLPreparedStatement, PgSQLPreparedStatement, and SQLitePreparedStatement.

PreparedStatementCommon::setClob ( $  paramIndex,  $  clob )

 

See also PreparedStatement::setClob()

Reimplemented from PreparedStatement.

Reimplemented in OCI8PreparedStatement.

PreparedStatementCommon::setDate ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented from PreparedStatement.

PreparedStatementCommon::setDecimal ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
double $value

Returns void

PreparedStatementCommon::setDouble ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
double $value

Returns void

PreparedStatementCommon::setFloat ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
float $value

Returns void

Reimplemented from PreparedStatement.

PreparedStatementCommon::setInt ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
int $value

Returns void

Reimplemented from PreparedStatement.

PreparedStatementCommon::setInteger ( $  paramIndex,  $  value )

 

Alias for setInt()

Parameters:
int $paramIndex
int $value

PreparedStatementCommon::setNull ( $  paramIndex)

 

Parameters:
int $paramIndex

Returns void

Reimplemented from PreparedStatement.

Reimplemented in MSSQLCallableStatement.

PreparedStatementCommon::setString ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented from PreparedStatement.

PreparedStatementCommon::setTime ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented from PreparedStatement.

PreparedStatementCommon::setTimestamp ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented from PreparedStatement.


Member Data Documentation

PreparedStatementCommon::$conn

 

PreparedStatementCommon::$limit = 0

 

PreparedStatementCommon::$offset = 0

 

PreparedStatementCommon::$sql

 

Reimplemented in OCI8PreparedStatement.

PreparedStatementCommon::$positions

 

PreparedStatementCommon::$positionsCount

 

PreparedStatementCommon::$boundInVars = array()

 

PreparedStatementCommon::$resultSet

 

PreparedStatementCommon::$updateCount

 


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


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS