db = $db; # decide connector... pretty ugly in joomla since there's nothing like related config if(function_exists('mysql_ping')) { if(!@mysql_ping($db->_resource)) { $this->ctype = 'mysqli'; } } $this->result = $db->query(); } function loadNextObject(&$object) { if(!$this->result) { return FALSE; } # look /joomla/database.php@458 and may bind to existing object?! if($this->ctype=='mysqli') { $object = mysqli_fetch_object($this->result); } else { $object = mysql_fetch_object($this->result); } if($object===NULL || $object===FALSE) { return FALSE; } return TRUE; } function Reset() { if($this->ctype=='mysqli') { mysqli_data_seek($this->result, 0); } else { mysql_data_seek($this->result, 0); } return TRUE; } function Free() { // free resource if(is_resource($this->db)) { if($this->ctype=='mysqli') { mysqli_free_result($this->result); } else { mysql_free_result($this->result); } } return TRUE; } } ?>