Class db_result

Description

Class representing a query result for a database.

  • abstract:

Located in /include/db.php (line 14)


	
			
Direct descendents
Class Description
db_postgresql_result Class representing a query result for a PostgreSQL database.
db_mysql_result Class representing a query result for a MySQL database.
Variable Summary
mixed $aff
mixed $conn
mixed $ign
mixed $query
Method Summary
int affected_rows ()
array fetch_array ([int $row = FETCH_NEXTROW], [int $method = FETCH_BOTH])
string field_name (int $num)
string field_type (int $num)
bool free_result ()
int last_insert_id (string $table, string $key)
int num_fields ()
int num_rows ()
Variables
mixed $aff (line 19)
  • access: protected
mixed $conn (line 16)
  • access: protected
mixed $ign (line 18)
  • access: protected
mixed $query (line 17)
  • access: protected
Methods
affected_rows (line 99)

Returns the number of affected rows of the query.

Note: this works only for INSERT, UPDATE and DELETE queries. Use num_rows to determine the number of rows in a SELECT query.

int affected_rows ()
fetch_array (line 75)

Fetches a record as an associative array from a result set.

The heart of the result class, this function returns an associative array representing one row of the result set. Callers can specify whether they want numerically indexed or associative arrays, or both (the default).

  • abstract:
array fetch_array ([int $row = FETCH_NEXTROW], [int $method = FETCH_BOTH])
  • int $row: the number of the row in the result set. can be null to fetch the next row in the set.
  • int $method: determines the kind of array to return

Redefined in descendants as:
field_name (line 52)

Returns the name of the specified field number in the result set.

  • abstract:
string field_name (int $num)
  • int $num: the field number

Redefined in descendants as:
field_type (line 59)

Returns the type of the specified field number in the result set.

  • abstract:
string field_type (int $num)
  • int $num: the field number

Redefined in descendants as:
free_result (line 85)

Frees the memory used by the query result.

Note that further operations on this instance will be undefined! Returns true if the operation succeeded.

  • access: protected
bool free_result ()

Redefined in descendants as:
last_insert_id (line 110)

Returns the last inserted id for the specified column and table.

  • abstract:
int last_insert_id (string $table, string $key)
  • string $table: the name of the table
  • string $key: the name of the primary key column

Redefined in descendants as:
num_fields (line 39)

Returns the number of fields per row in the result set.

  • abstract:
int num_fields ()

Redefined in descendants as:
num_rows (line 45)

Returns the number of rows in the result set.

  • abstract:
int num_rows ()

Redefined in descendants as:

Documentation generated on Fri, 30 Jun 2006 10:31:37 +0200 by phpDocumentor 1.3.0RC3