Class DatabaseMysqlResult

Description

MySQL database result

This implements access to database result sets

Located in /program/lib/database/mysql.class.php (line 1036)


	
			
Variable Summary
 integer $errno
 string $error
 integer $num_rows
 resource $result
Method Summary
 void DatabaseMysqlResult (resource $result)
 bool close ()
 array fetch_all ()
 array fetch_all_assoc ([string $keyfield = ''])
 array|bool fetch_row ()
 array|bool fetch_row_assoc ()
Variables
integer $errno (line 1041)
  • var: the error number generated by the latest mysql command
string $error (line 1044)
  • var: the error message generated by the latest mysql command
integer $num_rows (line 1047)
  • var: the number of rows in the result set
resource $result (line 1038)
  • var: the resource associated with the result set
Methods
Constructor DatabaseMysqlResult (line 1053)

constructor

void DatabaseMysqlResult (resource $result)
  • resource $result: the resource associated with the result set
close (line 1065)

free the memory associated with the result set

  • return: FALSE on failure, TRUE otherwise
bool close ()
fetch_all (line 1095)

fetch all rows as a 0-based array of 0-based enumerated arrays

  • return: an array containing 0 or more result rows as 0-based arrays
array fetch_all ()
fetch_all_assoc (line 1115)

fetch all rows as an array (0-based or keyed) of associative arrays

This returns an array of assoc arrays (one per record). If $key is not empty, we use the contents of the field as the array key, otherwise we simply use a 0-based numeric key. By specifying a single unique field (e.g. the primary key) all records in the array can be accessed via their unique value.

  • return: an array containing 0 or more result rows as associative arrays
array fetch_all_assoc ([string $keyfield = ''])
  • string $keyfield: field to use as the key in the returned array or empty for 0-based numeric array key
fetch_row (line 1077)

fetch the next result row as a 0-based enumerated array

  • return: FALSE if there are no more rows, or a 0-based array corresponding to a row
array|bool fetch_row ()
fetch_row_assoc (line 1086)

fetch the next result row as a associative array

  • return: FALSE if there are no more rows, or an associative array corresponding to a row
array|bool fetch_row_assoc ()

Documentation generated on Tue, 28 Jun 2016 19:10:41 +0200 by phpDocumentor 1.4.0