href=\target=\ } else {
echo \ print_r($this->error_message);
//echo %urlencode($this->error_message[2]['error']) . \ } exit; }
/* 仿真 Adodb 函数 */
function selectLimit($sql, $num, $start = 0) {
if ($start == 0) {
$sql .= ' LIMIT ' . $num; } else {
$sql .= ' LIMIT ' . $start . ', ' . $num; }
return $this->query($sql); }
function getOne($sql, $limited = false) {
if ($limited == true) {
$sql = trim($sql . ' LIMIT 1'); }
$res = $this->query($sql); if ($res !== false) {
$row = $res->fetch_row(); $res->free(); if ($row !== false) {
return $row[0]; } else {
return ''; } } else {
return false; } }
function getOneCached($sql, $cached = 'FILEFIRST') {
$sql = trim($sql . ' LIMIT 1');
$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time; if (!$cachefirst) {
return $this->getOne($sql, true); } else {
$result = $this->getSqlCacheData($sql, $cached); if (empty($result['storecache']) == true) {
return $result['data']; } }
$arr = $this->getOne($sql, true);
if ($arr !== false && $cachefirst)
{
$this->setSqlCacheData($result, $arr); }
return $arr; }
function getAll($sql) {
$res = $this->query($sql); if ($res !== false) {
$arr = $res->fetch_all(MYSQLI_ASSOC); $res->free(); return $arr; } else {
return false; } }
function getAllCached($sql, $cached = 'FILEFIRST') {
$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time; if (!$cachefirst) {
return $this->getAll($sql); } else {
$result = $this->getSqlCacheData