.

DBResultSetMysql Class Reference
[Model]

Result set for MySQL. More...

Inheritance diagram for DBResultSetMysql:
IDBResultSet

List of all members.

Public Member Functions

  __construct ($result_handle, $status)
  __destruct ()
  close ()
  Closes internal cursor.
  fetch ()
  Returns row as associative array.
  get_column_count ()
  Returns number of columns in result set.
  get_row_count ()
  Returns number of rows in result set.
  get_status ()
  Returns status.

Protected Attributes

  $result_handle = null
  $status = null

Detailed Description

Result set for MySQL.

Author:
Gerd Riesselmann

Definition at line 8 of file dbresultset.mysql.php.


Constructor & Destructor Documentation

DBResultSetMysql::__construct ( result_handle,
status  
)

Definition at line 22 of file dbresultset.mysql.php.

00022                                                              {
00023                 $this->result_handle = $result_handle;
00024                 $this->status = $status;
00025         }
DBResultSetMysql::__destruct (  ) 

Definition at line 27 of file dbresultset.mysql.php.

00027                                      {
00028                 $this->close();
00029         }

Member Function Documentation

DBResultSetMysql::close (  ) 

Closes internal cursor.

Returns:
void

Implements IDBResultSet.

Definition at line 36 of file dbresultset.mysql.php.

00036                                 {
00037                 if ($this->result_handle) {
00038                         mysql_free_result($this->result_handle);
00039                 }
00040                 $this->result_handle = null;
00041         }
DBResultSetMysql::fetch (  ) 

Returns row as associative array.

Returns:
array | bool False if no more data is available

Implements IDBResultSet.

Definition at line 72 of file dbresultset.mysql.php.

00072                                 {
00073                 if ($this->result_handle) {
00074                         return mysql_fetch_assoc($this->result_handle);
00075                 }
00076                 return false;
00077         }
DBResultSetMysql::get_column_count (  ) 

Returns number of columns in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 48 of file dbresultset.mysql.php.

00048                                            {
00049                 if ($this->result_handle) {
00050                         return mysql_num_fields($this->result_handle);
00051                 }
00052                 return false;
00053         }
DBResultSetMysql::get_row_count (  ) 

Returns number of rows in result set.

Returns:
int

Implements IDBResultSet.

Definition at line 60 of file dbresultset.mysql.php.

00060                                         {
00061                 if ($this->result_handle) {
00062                         return mysql_num_rows($this->result_handle);
00063                 }
00064                 return 0;
00065         }
DBResultSetMysql::get_status (  ) 

Returns status.

Parameters:
Status 

Implements IDBResultSet.

Definition at line 84 of file dbresultset.mysql.php.

00084                                      {
00085                 return $this->status;
00086         }

Member Data Documentation

DBResultSetMysql::$result_handle = null [protected]

Definition at line 14 of file dbresultset.mysql.php.

DBResultSetMysql::$status = null [protected]

Definition at line 20 of file dbresultset.mysql.php.


The documentation for this class was generated from the following file: