Line 192 | Line 192 |
---|
}
return false;
|
}
return false;
|
| }
/** * Seek to given row number * rownum is zero-based */ function sql_rowseek($rownum, &$query_id) { global $cache;
if ($query_id === false) { $query_id = $this->query_result; }
if (isset($cache->sql_rowset[$query_id])) { return $cache->sql_rowseek($rownum, $query_id); }
if ($query_id === false) { return false; }
$this->sql_freeresult($query_id); $query_id = $this->sql_query($this->last_query_text);
if ($query_id === false) { return false; }
// We do not fetch the row for rownum == 0 because then the next resultset would be the second row for ($i = 0; $i < $rownum; $i++) { if (!$this->sql_fetchrow($query_id)) { return false; } }
return true;
|
}
/**
| }
/**
|
Line 239 | Line 282 |
---|
$expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
|
$expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
|
| }
/** * Returns whether results of a query need to be buffered to run a transaction while iterating over them. * * @return bool Whether buffering is required. */ function sql_buffer_nested_transactions() { return false;
|
}
/**
| }
/**
|
Line 445 | Line 498 |
---|
}
return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
|
}
return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
|
| }
/** * Run LOWER() on DB column of type text (i.e. neither varchar nor char). * * @param string $column_name The column name to use * * @return string A SQL statement like "LOWER($column_name)" */ function sql_lower_text($column_name) { return "LOWER($column_name)";
|
}
/**
| }
/**
|
Line 599 | Line 664 |
---|
} }
|
} }
|
$sql .= $this->_sql_custom_build('FROM', implode(', ', $table_array));
| $sql .= $this->_sql_custom_build('FROM', implode(' CROSS JOIN ', $table_array));
|
if (!empty($array['LEFT_JOIN'])) {
| if (!empty($array['LEFT_JOIN'])) {
|
Line 652 | Line 717 |
---|
// The DEBUG_EXTRA constant is for development only! if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) {
|
// The DEBUG_EXTRA constant is for development only! if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) {
|
// Print out a nice backtrace... $backtrace = get_backtrace();
| |
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
|
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
|
$message .= ($backtrace) ? '<br /><br />BACKTRACE<br />' . $backtrace : ''; $message .= '<br />';
| |
} else {
| } else {
|
Line 767 | Line 827 |
---|
</div> </div> <div id="page-footer">
|
</div> </div> <div id="page-footer">
|
Powered by phpBB © 2000, 2002, 2005, 2007 <a href="http://www.phpbb.com/">phpBB Group</a>
| Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Group
|
</div> </div> </body>
| </div> </div> </body>
|
Line 894 | Line 954 |
---|
}
return true;
|
}
return true;
|
| }
/** * Gets the estimated number of rows in a specified table. * * @param string $table_name Table name * * @return string Number of rows in $table_name. * Prefixed with ~ if estimated (otherwise exact). * * @access public */ function get_estimated_row_count($table_name) { return $this->get_row_count($table_name); }
/** * Gets the exact number of rows in a specified table. * * @param string $table_name Table name * * @return string Exact number of rows in $table_name. * * @access public */ function get_row_count($table_name) { $sql = 'SELECT COUNT(*) AS rows_total FROM ' . $this->sql_escape($table_name); $result = $this->sql_query($sql); $rows_total = $this->sql_fetchfield('rows_total'); $this->sql_freeresult($result);
return $rows_total;
|
} }
| } }
|