Package: IBase_Driver

IBase_Query
IBase_Driver

public class IBase_Query extends Query

Return to package list

Version: 0.6
Date: 2001-05-29 11:05:37

Author: John Luxford <lux@simian.ca> <http://www.simian.ca/>

Summary
IBase_Driver is the Database driver for the InterBase database system.
IBase_Query provides all of the InterBase-specific functionality
for Query objects.  It is accessed through the Database class API.

Example
$q = new IBase_Query ("select * from table");
if ($q->execute ()) {
	while ($row = $q->fetch ()) {
		// do something with $row
	}
	$q->free ();
} else {
	// query failed
}

Properties

public string $sql

Summary
Contains the SQL query to be executed.

public resource $result

Summary
Contains the result identifier for the current execution.

public string $field

Summary
Currently unused.

public resource $connection

Summary
The resource ID for the database connection to be queried.

Methods

public MySQL_Query (string $sql, resource $conn) -> void

Summary
Constructor method.

$sql is the SQL query you wish to execute with this object.
$conn is the database connection resource to be queried.

public execute (array $values) -> resource

Summary
Executes the current SQL query.

$values is an array of values to substitute.  The syntax for denoting
bind_values in the SQL query is a double-questionmark (??).

Returns the new SQL query.  Note: does not modify the actual $sql property.

public field (integer $num) -> string

Summary
Returns the name of the specified column in the table currently being queried.

$num is the column number.  Note: Some database systems begin with
column 0, while others with 1.

public rows () -> integer

Summary
Returns the number of rows affected or found by the current query.

Note: Uses the ibase_num_fields() function, which does not work correctly
in PHP4.

public lastid () -> integer

Summary
Returns the row ID generated by the database during the previous
SQL insert query.

Note: Not yet implemented.

public fetch () -> object

Summary
Returns the next row of data from the current query, always in the
form of an object, with each column as its properties.

public free () -> void

Summary
Tells the database system to let go of its data from the previous
query.

public begin () -> void

Summary
Issues an ibase_trans() statement, beginning a transaction.

public commit () -> void

Summary
Issues an ibase_commet() statement, committing the current transaction.

public rollback () -> void

Summary
Issues an ibase_rollback() statement, rolling back the current transaction.

Return to Top

public class IBase_Driver

Return to package list

Version: 0.6
Date: 2001-05-29 11:05:37

Author: John Luxford <lux@simian.ca> <http://www.simian.ca/>

Summary
IBase_Driver provides all of the InterBase-specific functionality
for Database objects.  It is accessed through the Database class API.

Example
$db = new IBase_Driver ("name", "host", "user", "pass", 1);

if ($db->connection) {
	// connection worked
} else {
	// connection failed
}

Properties

public resource $connection

Summary
Contains the database connection resource.

public string $name

Summary
Contains the name of the database being used.

public string $host

Summary
Contains the name of the database host.

public string $user

Summary
Contains the username used to connect to the current database.

public string $pass

Summary
Contains the password used to connect to the current database.

public boolean $persistent

Summary
A 1 or 0 (true or false, and true by default), specifying whether
to establish a persistent connection or not.

Methods

public IBase_Driver (string $name, string $host, string $user, string $pass, boolean $persistent = '1') -> void

Summary
Constructor method.

public connect () -> void

Summary
Establishes a connection with the database

public query (string $sql) -> object

Summary
Creates and returns a Query object.

$sql is the SQL query you wish to execute with this object.

Return to Top


This file was created by DocReader, an Open Source class documentation system.
Visit Simian Systems to learn more.