Line 115 | Line 115 |
---|
*/ function sql_exists($query_id) {
|
*/ function sql_exists($query_id) {
|
| $query_id = $this->clean_query_id($query_id);
|
return isset($this->sql_rowset[$query_id]); }
| return isset($this->sql_rowset[$query_id]); }
|
Line 123 | Line 124 |
---|
*/ function sql_fetchrow($query_id) {
|
*/ function sql_fetchrow($query_id) {
|
| $query_id = $this->clean_query_id($query_id);
|
if ($this->sql_row_pointer[$query_id] < count($this->sql_rowset[$query_id])) { return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
| if ($this->sql_row_pointer[$query_id] < count($this->sql_rowset[$query_id])) { return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
|
Line 136 | Line 138 |
---|
*/ function sql_fetchfield($query_id, $field) {
|
*/ function sql_fetchfield($query_id, $field) {
|
| $query_id = $this->clean_query_id($query_id);
|
if ($this->sql_row_pointer[$query_id] < count($this->sql_rowset[$query_id])) { return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
| if ($this->sql_row_pointer[$query_id] < count($this->sql_rowset[$query_id])) { return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
|
Line 149 | Line 152 |
---|
*/ function sql_rowseek($rownum, $query_id) {
|
*/ function sql_rowseek($rownum, $query_id) {
|
| $query_id = $this->clean_query_id($query_id);
|
if ($rownum >= count($this->sql_rowset[$query_id])) { return false;
| if ($rownum >= count($this->sql_rowset[$query_id])) { return false;
|
Line 163 | Line 167 |
---|
*/ function sql_freeresult($query_id) {
|
*/ function sql_freeresult($query_id) {
|
| $query_id = $this->clean_query_id($query_id);
|
if (!isset($this->sql_rowset[$query_id])) { return false;
| if (!isset($this->sql_rowset[$query_id])) { return false;
|
Line 230 | Line 235 |
---|
}
@rmdir($dir);
|
}
@rmdir($dir);
|
| }
/** * {@inheritDoc} */ public function clean_query_id($query_id) { // Some DBMS functions accept/return objects and/or resources instead of integer identifier // Attempting to cast object to int will throw error, hence correctly handle all cases if (is_resource($query_id)) { return function_exists('get_resource_id') ? get_resource_id($query_id) : (int) $query_id; } else { return is_object($query_id) ? spl_object_id($query_id) : $query_id; }
|
} }
| } }
|