ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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. More...
 
 valid ()
 Check if the end of the result set has been reached. More...
 
 numRows ()
 Returns the number of rows in a result object. More...
 
 nextResult ()
 Move the internal result pointer to the next available result. More...
 
- 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. More...
 
 _getColumnNames ()
 Retrieve the names of columns returned by the DBMS in a query result. More...
 
 numCols ()
 Count the number of columns returned by the DBMS in a query result. More...
 
 nextResult ()
 Move the internal result pointer to the next available result. More...
 
 free ()
 Free the internal resources associated with result. More...
 
- Public Member Functions inherited from MDB2_Result_Common
 __construct ($db, $result, $limit=0, $offset=0)
 Constructor. More...
 
 fetch ($fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
 
 fetchObject ()
 
 fetchAssoc ()
 
 MDB2_Result_Common ($db, $result, $limit=0, $offset=0)
 PHP 4 Constructor. More...
 
 setResultTypes ($types)
 Define the list of types to be associated with the columns of a given result set. More...
 
 seek ($rownum=0)
 Seek to a specific row in a result set. More...
 
fetchRow ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rownum=null)
 Fetch and return a row of data. More...
 
 fetchOne ($colnum=0, $rownum=null)
 fetch single column from the next row from a result set More...
 
 fetchCol ($colnum=0)
 Fetch and return a column from the current row pointer position. More...
 
 fetchAll ($fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false)
 Fetch and return all rows from the current row pointer position. More...
 
 rowCount ()
 Returns the actual row number that was last fetched (count from 0) More...
 
 numRows ()
 Returns the number of rows in a result object. More...
 
 nextResult ()
 Move the internal result pointer to the next available result. More...
 
 getColumnNames ($flip=false)
 Retrieve the names of columns returned by the DBMS in a query result or from the cache. More...
 
 _getColumnNames ()
 Retrieve the names of columns returned by the DBMS in a query result. More...
 
 numCols ()
 Count the number of columns returned by the DBMS in a query result. More...
 
 getResource ()
 return the resource associated with the result object More...
 
 bindColumn ($column, &$value, $type=null)
 Set bind variable to a column. More...
 
 _assignBindColumns ($row)
 Bind a variable to a value in the result row. More...
 
 free ()
 Free the internal resources associated with result. More...
 
 execute ($a_data=null)
 
- Public Member Functions inherited from ilDBStatement
 fetchRow ($fetch_mode)
 

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

◆ nextResult()

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

Definition at line 1424 of file mysqli.php.

References MDB2_Driver_Common\$connection, PEAR\isError(), and MDB2_OK.

1425  {
1426  $connection = $this->db->getConnection();
1427  if (PEAR::isError($connection)) {
1428  return $connection;
1429  }
1430 
1431  if (!@mysqli_more_results($connection)) {
1432  return false;
1433  }
1434  if (!@mysqli_next_result($connection)) {
1435  return false;
1436  }
1437  if (!($this->result = @mysqli_store_result($connection))) {
1438  return false;
1439  }
1440  return MDB2_OK;
1441  }
const MDB2_OK(!class_exists('PEAR'))
The method mapErrorCode in each MDB2_dbtype implementation maps native error codes to one of these...
Definition: MDB2.php:72
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:280
+ Here is the call graph for this function:

◆ numRows()

MDB2_BufferedResult_mysqli::numRows ( )

Returns the number of rows in a result object.

Returns
mixed MDB2 Error Object or the number of rows public

Implements ilDBStatement.

Definition at line 1398 of file mysqli.php.

References $rows, and MDB2_ERROR_NEED_MORE_DATA.

1399  {
1400  $rows = @mysqli_num_rows($this->result);
1401  if (is_null($rows)) {
1402  if ($this->result === false) {
1403  return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
1404  'resultset has already been freed', __FUNCTION__);
1405  } elseif (is_null($this->result)) {
1406  return 0;
1407  }
1408  return $this->db->raiseError(null, null, null,
1409  'Could not get row count', __FUNCTION__);
1410  }
1411  return $rows;
1412  }
const MDB2_ERROR_NEED_MORE_DATA
Definition: MDB2.php:92
$rows
Definition: xhr_table.php:10

◆ seek()

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

Definition at line 1355 of file mysqli.php.

References MDB2_ERROR_INVALID, MDB2_ERROR_NEED_MORE_DATA, and MDB2_OK.

1356  {
1357  if ($this->rownum != ($rownum - 1) && !@mysqli_data_seek($this->result, $rownum)) {
1358  if ($this->result === false) {
1359  return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null,
1360  'resultset has already been freed', __FUNCTION__);
1361  } elseif (is_null($this->result)) {
1362  return MDB2_OK;
1363  }
1364  return $this->db->raiseError(MDB2_ERROR_INVALID, null, null,
1365  'tried to seek to an invalid row number ('.$rownum.')', __FUNCTION__);
1366  }
1367  $this->rownum = $rownum - 1;
1368  return MDB2_OK;
1369  }
const MDB2_OK(!class_exists('PEAR'))
The method mapErrorCode in each MDB2_dbtype implementation maps native error codes to one of these...
Definition: MDB2.php:72
const MDB2_ERROR_INVALID
Definition: MDB2.php:80
const MDB2_ERROR_NEED_MORE_DATA
Definition: MDB2.php:92

◆ valid()

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().

1381  {
1382  $numrows = $this->numRows();
1383  if (PEAR::isError($numrows)) {
1384  return $numrows;
1385  }
1386  return $this->rownum < ($numrows - 1);
1387  }
numRows()
Returns the number of rows in a result object.
Definition: mysqli.php:1398
isError($data, $code=null)
Tell whether a value is a PEAR error.
Definition: PEAR.php:280
+ Here is the call graph for this function:

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