ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
MDB2_BufferedResult_mysqli Class Reference
+ Inheritance diagram for MDB2_BufferedResult_mysqli:
+ Collaboration diagram for MDB2_BufferedResult_mysqli:

Public Member Functions

 seek ($rownum=0)
 Seek to a specific row in a result set.
 valid ()
 Check if the end of the result set has been reached.
 numRows ()
 Returns the number of rows in a result object.
 nextResult ()
 Move the internal result pointer to the next available result.
- Public Member Functions inherited from MDB2_Result_mysqli
fetchRow ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rownum=null)
 Fetch a row and insert the data into an existing array.
 _getColumnNames ()
 Retrieve the names of columns returned by the DBMS in a query result.
 numCols ()
 Count the number of columns returned by the DBMS in a query result.
 free ()
 Free the internal resources associated with result.
- Public Member Functions inherited from MDB2_Result_Common
 __construct (&$db, &$result, $limit=0, $offset=0)
 Constructor.
 MDB2_Result_Common (&$db, &$result, $limit=0, $offset=0)
 PHP 4 Constructor.
 setResultTypes ($types)
 Define the list of types to be associated with the columns of a given result set.
 fetchOne ($colnum=0, $rownum=null)
 fetch single column from the next row from a result set
 fetchCol ($colnum=0)
 Fetch and return a column from the current row pointer position.
 fetchAll ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false)
 Fetch and return all rows from the current row pointer position.
 rowCount ()
 Returns the actual row number that was last fetched (count from 0)
 getColumnNames ($flip=false)
 Retrieve the names of columns returned by the DBMS in a query result or from the cache.
 getResource ()
 return the resource associated with the result object
 bindColumn ($column, &$value, $type=null)
 Set bind variable to a column.
 _assignBindColumns ($row)
 Bind a variable to a value in the result row.

Additional Inherited Members

- Data Fields inherited from MDB2_Result_Common
 $db
 $result
 $rownum = -1
 $types = array()
 $values = array()
 $offset
 $offset_count = 0
 $limit
 $column_names

Detailed Description

Definition at line 1343 of file mysqli.php.

Member Function Documentation

MDB2_BufferedResult_mysqli::nextResult ( )

Move the internal result pointer to the next available result.

Parameters
avalid result resource
Returns
true on success, false if there is no more result set or an error object on failure public

Reimplemented from MDB2_Result_mysqli.

Definition at line 1424 of file mysqli.php.

References PEAR\isError(), and MDB2_OK.

{
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
return $connection;
}
if (!@mysqli_more_results($connection)) {
return false;
}
if (!@mysqli_next_result($connection)) {
return false;
}
if (!($this->result = @mysqli_store_result($connection))) {
return false;
}
return MDB2_OK;
}

+ Here is the call graph for this function:

MDB2_BufferedResult_mysqli::numRows ( )

Returns the number of rows in a result object.

Returns
mixed MDB2 Error Object or the number of rows public

Reimplemented from MDB2_Result_Common.

Definition at line 1398 of file mysqli.php.

References MDB2_ERROR_NEED_MORE_DATA.

Referenced by valid().

{
$rows = @mysqli_num_rows($this->result);
if (is_null($rows)) {
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
} elseif (is_null($this->result)) {
return 0;
}
return $this->db->raiseError(null, null, null,
'Could not get row count', __FUNCTION__);
}
return $rows;
}

+ Here is the caller graph for this function:

MDB2_BufferedResult_mysqli::seek (   $rownum = 0)

Seek to a specific row in a result set.

Parameters
int$rownumnumber of the row where the data can be found
Returns
mixed MDB2_OK on success, a MDB2 error on failure public

Reimplemented from MDB2_Result_Common.

Definition at line 1355 of file mysqli.php.

References MDB2_Result_Common\$rownum, MDB2_ERROR_INVALID, MDB2_ERROR_NEED_MORE_DATA, and MDB2_OK.

{
if ($this->rownum != ($rownum - 1) && !@mysqli_data_seek($this->result, $rownum)) {
if ($this->result === false) {
return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
'resultset has already been freed', __FUNCTION__);
} elseif (is_null($this->result)) {
return MDB2_OK;
}
return $this->db->raiseError(MDB2_ERROR_INVALID, null, null,
'tried to seek to an invalid row number ('.$rownum.')', __FUNCTION__);
}
$this->rownum = $rownum - 1;
return MDB2_OK;
}
MDB2_BufferedResult_mysqli::valid ( )

Check if the end of the result set has been reached.

Returns
mixed true or false on sucess, a MDB2 error on failure public

Definition at line 1380 of file mysqli.php.

References PEAR\isError(), and numRows().

{
$numrows = $this->numRows();
if (PEAR::isError($numrows)) {
return $numrows;
}
return $this->rownum < ($numrows - 1);
}

+ Here is the call graph for this function:


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