phppdo — This class implements an generic PDO-based DBAPI
phppdo is part of the DBAPI package.
class phppdo extends DBAPI { private int $affected_rows private resource $link private string $query public phppdo __construct ( string $dsn, string $username, string $password, string $options ); public int affectedrows ( void ); public void close ( void ); public string errno ( void ); public string error ( void ); public mixed escape ( mixed $var ); protected resource execute_query ( string $query ); public array fetchrow ( resource $result ); public array fetchrowset ( resource $result ); public void freeresult ( resource $result ); public int lastid ( void ); protected string limit_query ( string $query, int $length, int $start ); }
DBAPI +----phppdo
This class implements an generic PDO-based DBAPI
private int $affected_rows
The number of rows affected by the last query
Default value: empty string
private resource $link
The database connection resource
Default value: empty string
private string $query
A copy of the query. Used for reporting errors
Default value: empty string
public phppdo __construct ( string $dsn, string $username, string $password, string $options );
Create a database connection
This function is identical to PHP's PDO() constructor.
public int affectedrows ( void );
Get the number of rows affected by the last query
public void close ( void );
Close the connection
public string errno ( void );
Return the last SQL error number
public string error ( void );
Return the last SQL error message
public mixed escape ( mixed $var );
Escape a variable to safely use in in SQL
protected resource execute_query ( string $query );
Execute a single SQL query
public array fetchrow ( resource $result );
Fetch a single row from the SQL result set. If no result is specified, it uses the last returned result
public array fetchrowset ( resource $result );
Fetch an array of rows from the SQL result set. If no result is specified, it uses the last returned result
public void freeresult ( resource $result );
Free an SQL result resource. If no result is specified, it uses the last returned result
There is no function to free a PDO result resource
public int lastid ( void );
Get the unique ID of the last row that was insterted in the database
protected string limit_query ( string $query, int $length, int $start );
Modify a query to limit the size of the returned result set