sqlite2 — This class implements an SQLite2 specific DBAPI
sqlite2 is part of the DBAPI package.
class sqlite2 extends DBAPI { private resource $link private string $query public sqlite2 __construct ( string $dsn, string $username, string $password, string $options ); public int affectedrows ( void ); public void close ( void ); public int 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 +----sqlite2
This class implements an SQLite2 specific DBAPI
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 sqlite2 __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 int 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 an SQLite 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