Page MenuHomeDevCentral

MySQLDatabaseResult.php
No OneTemporary

MySQLDatabaseResult.php

<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Database base class
*
* @package ObsidianWorkspaces
* @subpackage Keruald
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*
*/
class MySQLDatabaseResult extends DatabaseResult {
///
/// Private members
///
/**
* @var resource The resource to the MySQL result
*/
private $result;
///
/// Constructor
///
/**
* Initializes a new instance of the MySQLDatabaseResult class
*
* @param resource $result the resource to the MySQL result
*/
public function MySQLDatabaseResult ($result) {
$this->result = $result;
}
///
/// DatabaseResult implementation
///
/**
* Gets number of rows in result
*
* @return int The number of rows in the specified result
*/
public function numRows () {
return mysql_num_rows($this->result);
}
/**
* Fetches a row of the result
*
* @param DatabaseResult $result The query result
* @return array An associative array with the databae result
*/
public function fetchRow () {
return mysql_fetch_array($this->result);
}
///
/// IteratorAggregate implementation
///
/**
* Gets an iterator
*
* @return Generator an iterator on the query result
*/
public function getIterator () {
while ($row = $this->fetchRow()) {
yield $row;
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Aug 8, 02:55 (15 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3943475
Default Alt Text
MySQLDatabaseResult.php (1 KB)

Event Timeline