hi ppl. i'm doing a tutorial from PHP Object-Oriented Solutions, a david powers book (
http://www.amazon.com/PHP-Object-Oriented-Solutions-David-Powers/dp/1430210117/ref=sr_1_3?ie=UTF8&s=books&qid=1261679189&sr=8-3 )
in pg 296 there is a method to connect to mysqli, in class Pos_MysqlOriginalConnection:
PHP Code:
public function getResultSet($sql) {
$results = new Pos_MysqlOriginalResult($sql, $this->_connection);
return $results;
}
the class Pos_MysqlOriginalResult() has the following definition:
PHP Code:
public function __construct($sql, $connection) {
if (!$this->_result = mysql_query($sql, $connection)) {
throw new Exception(mysql_error($connection) . '. The actual query submitted was: ' . $sql);
}
}
this class works, and i get the results, with all the tables. what troubles me is that i don't understand why, because they become stored in "this->_result", inside Pos_MysqlOriginalResult(), and i don't see how the property $results gets that data.
if i could inderstand that, i could extend the class Pos_MysqlOriginalResult, to perform several database related operations. Can anyone shed some light into this, please?