亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? query_factory.php

?? Easy_Buy是一個在線銷售系統
?? PHP
字號:
<?php
/** 
 * MySQL query_factory Class.
 * Class used for database abstraction to MySQL
 *
 * @package classes
 * @copyright Copyright 2003-2006 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: query_factory.php 3195 2006-03-16 05:13:47Z drbyte $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
/**
 * Queryfactory - A simple database abstraction layer
 *
 */
class queryFactory extends base {

  function queryFactory() {
    $this->count_queries = 0;
    $this->total_query_time = 0;
  }

  function connect($zf_host, $zf_user, $zf_password, $zf_database, $zf_pconnect = 'false', $zp_real = false) {
//@TODO error class required to virtualise & centralise all error reporting/logging/debugging
    $this->database = $zf_database;

    if ($zf_pconnect != 'false') {
      $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    } else {
    // pconnect disabled ... leaving it as "connect" here instead of "pconnect"
      $this->link = @mysql_connect($zf_host, $zf_user, $zf_password, true);
    }
    if ($this->link) {
      if (@mysql_select_db($zf_database, $this->link)) {
        $this->db_connected = true;
        return true;
      } else {
        $this->set_error(mysql_errno(),mysql_error(), $zp_real);
        return false;
      }
    } else {
      $this->set_error(mysql_errno(),mysql_error(), $zp_real);
      return false;
    }
  }

  function selectdb($zf_database) {
    @mysql_select_db($zf_database, $this->link);
  }

  function prepare_input($zp_string) {
    if (function_exists('mysql_real_escape_string')) {
      return mysql_real_escape_string($zp_string);
    } elseif (function_exists('mysql_escape_string')) {
      return mysql_escape_string($zp_string);
    } else {
      return addslashes($zp_string);
    }
  }

  function close() {
    @mysql_close($this->link);
  }

  function set_error($zp_err_num, $zp_err_text, $zp_fatal = true) {
    $this->error_number = $zp_err_num;
    $this->error_text = $zp_err_text;
    if ($zp_fatal && $zp_err_num != 1141) { // error 1141 is okay ... should not die on 1141, but just continue on instead
      $this->show_error();
      die();
    }
  }

  function show_error() {
    if ($this->error_number == 0 && $this->error_text == DB_ERROR_NOT_CONNECTED && !headers_sent() && file_exists('nddbc.html') ) include('nddbc.html');
    echo '<div class="systemError">';
    echo $this->error_number . ' ' . $this->error_text;
    echo '<br />in:<br />[' . $this->zf_sql . ']<br />';
    if (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG==true) echo 'If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.<br />';
    echo '</div>';
  }

  function Execute($zf_sql, $zf_limit = false, $zf_cache = false, $zf_cachetime=0) {
// bof: collect products_id queries
/* un comment to write files
    global $PHP_SELF, $box_id;
if (strtoupper(substr($zf_sql,0,6))=='SELECT' && strstr($zf_sql,'products_id')) {
  $f=fopen(DIR_FS_SQL_CACHE.'/query_list_selects_'.time().'.txt','a');
  fwrite($f,  "\n\n" . 'I AM HERE ' . $_GET['main_page'] . zen_get_all_get_params() . "\n" . 'sidebox: ' . $box_id . "\n\n" . $zf_sql.";\n\n");
  fclose($f);
  unset($f);
}
*/
// eof: collect products_id queries
    global $zc_cache;
    if ($zf_limit) {
      $zf_sql = $zf_sql . ' LIMIT ' . $zf_limit;
    }
    $this->zf_sql = $zf_sql;
    if ( $zf_cache AND $zc_cache->sql_cache_exists($zf_sql) AND !$zc_cache->sql_cache_is_expired($zf_sql, $zf_cachetime) ) {
      $obj = new queryFactoryResult;
      $obj->cursor = 0;
      $obj->is_cached = true;
      $obj->sql_query = $zf_sql;
      $zp_result_array = $zc_cache->sql_cache_read($zf_sql);
      $obj->result = $zp_result_array;
      if (sizeof($zp_result_array) > 0 ) {
        $obj->EOF = false;
        while (list($key, $value) = each($zp_result_array[0])) {
          $obj->fields[$key] = $value;
        }
        return $obj;
      } else {
        $obj->EOF = true;
      }
    } elseif ($zf_cache) {
      $zc_cache->sql_cache_expire_now($zf_sql);
      $time_start = explode(' ', microtime());
      $obj = new queryFactoryResult;
      $obj->sql_query = $zf_sql;
      if (!$this->db_connected) $this->set_error('0', DB_ERROR_NOT_CONNECTED);
      $zp_db_resource = @mysql_query($zf_sql, $this->link);
      if (!$zp_db_resource) $this->set_error(@mysql_errno(),@mysql_error());
      $obj->resource = $zp_db_resource;
      $obj->cursor = 0;
      $obj->is_cached = true;
      if ($obj->RecordCount() > 0) {
        $obj->EOF = false;
        $zp_ii = 0;
	while (!$obj->EOF) {
          $zp_result_array = @mysql_fetch_array($zp_db_resource);
          if ($zp_result_array) {
            while (list($key, $value) = each($zp_result_array)) {
              if (!ereg('^[0-9]', $key)) {
                $obj->result[$zp_ii][$key] = $value;
              }
            }
          } else {
            $obj->Limit = $zp_ii;
            $obj->EOF = true;
          }
          $zp_ii++;
	}
        while (list($key, $value) = each($obj->result[$obj->cursor])) {
          if (!ereg('^[0-9]', $key)) {
            $obj->fields[$key] = $value;
	  }
        }
        $obj->EOF = false;
      } else {
	$obj->EOF = true;
      }
      $zc_cache->sql_cache_store($zf_sql, $obj->result);
      $time_end = explode (' ', microtime());
      $query_time = $time_end[1]+$time_end[0]-$time_start[1]-$time_start[0];
      $this->total_query_time += $query_time;
      $this->count_queries++;
      return($obj);
    } else {
      $time_start = explode(' ', microtime());
      $obj = new queryFactoryResult;
      if (!$this->db_connected) $this->set_error('0', DB_ERROR_NOT_CONNECTED);
      $zp_db_resource = @mysql_query($zf_sql, $this->link);
      if (!$zp_db_resource) $this->set_error(@mysql_errno($this->link),@mysql_error($this->link));
      $obj->resource = $zp_db_resource;
      $obj->cursor = 0;
      if ($obj->RecordCount() > 0) {
        $obj->EOF = false;
        $zp_result_array = @mysql_fetch_array($zp_db_resource);
        if ($zp_result_array) {
          while (list($key, $value) = each($zp_result_array)) {
            if (!ereg('^[0-9]', $key)) {
              $obj->fields[$key] = $value;
            }
          }
          $obj->EOF = false;
        } else {
          $obj->EOF = true;
        }
      } else {
        $obj->EOF = true;
      }

      $time_end = explode (' ', microtime());
      $query_time = $time_end[1]+$time_end[0]-$time_start[1]-$time_start[0];
      $this->total_query_time += $query_time;
      $this->count_queries++;
      return($obj);
    }
  }

  function ExecuteRandomMulti($zf_sql, $zf_limit = 0, $zf_cache = false, $zf_cachetime=0) {
    $this->zf_sql = $zf_sql;
    $time_start = explode(' ', microtime());
    $obj = new queryFactoryResult;
    $obj->result = array();
    if (!$this->db_connected) $this->set_error('0', DB_ERROR_NOT_CONNECTED);
    $zp_db_resource = @mysql_query($zf_sql, $this->link);
    if (!$zp_db_resource) $this->set_error(mysql_errno(),mysql_error());
    $obj->resource = $zp_db_resource;
    $obj->cursor = 0;
    $obj->Limit = $zf_limit;
    if ($obj->RecordCount() > 0 && $zf_limit > 0) {
      $obj->EOF = false;
      $zp_Start_row = 0;
      if ($zf_limit) {
      $zp_start_row = zen_rand(0, $obj->RecordCount() - $zf_limit);
      }
      $obj->Move($zp_start_row);
      $obj->Limit = $zf_limit;
      $zp_ii = 0;
      while (!$obj->EOF) {
        $zp_result_array = @mysql_fetch_array($zp_db_resource);
        if ($zp_ii == $zf_limit) $obj->EOF = true;
        if ($zp_result_array) {
          while (list($key, $value) = each($zp_result_array)) {
            $obj->result[$zp_ii][$key] = $value;
          }
        } else {
          $obj->Limit = $zp_ii;
          $obj->EOF = true;
        }
        $zp_ii++;
      }
      $obj->result_random = array_rand($obj->result, sizeof($obj->result));
      if (is_array($obj->result_random)) {
        $zp_ptr = $obj->result_random[$obj->cursor];
      } else {
        $zp_ptr = $obj->result_random;
      }
      while (list($key, $value) = each($obj->result[$zp_ptr])) {
        if (!ereg('^[0-9]', $key)) {
          $obj->fields[$key] = $value;
	}
      }
      $obj->EOF = false;
    } else {
      $obj->EOF = true;
    }


    $time_end = explode (' ', microtime());
    $query_time = $time_end[1]+$time_end[0]-$time_start[1]-$time_start[0];
    $this->total_query_time += $query_time;
    $this->count_queries++;
    return($obj);
  }

  function insert_ID() {
    return @mysql_insert_id($this->link);
  }

  function metaColumns($zp_table) {
    $res = @mysql_query("select * from " . $zp_table . " limit 1", $this->link);
    $num_fields = @mysql_num_fields($res);
    for ($i = 0; $i < $num_fields; $i++) {
     $obj[strtoupper(@mysql_field_name($res, $i))] = new queryFactoryMeta($i, $res);
    }
    return $obj;

  }

  function get_server_info() {
    if ($this->link) {
      return mysql_get_server_info($this->link);
    } else {
      return UNKNOWN;
    }
  }

  function queryCount() {
    return $this->count_queries;
  }

  function queryTime() {
    return $this->total_query_time;
  }
  function perform ($tableName, $tableData, $performType='INSERT', $performFilter='', $debug=false) {
    switch (strtolower($performType)) {
      case 'insert':
      $insertString = "";
      $insertString = "INSERT INTO " . $tableName . " (";
      foreach ($tableData as $key => $value) {
        if ($debug === true) {
          echo $value['fieldName'] . '#';
        }
        $insertString .= $value['fieldName'] . ", ";
      }      
      $insertString = substr($insertString, 0, strlen($insertString)-2) . ') VALUES (';
      reset($tableData);
      foreach ($tableData as $key => $value) {
        $bindVarValue = $this->getBindVarValue($value['value'], $value['type']);
        $insertString .= $bindVarValue . ", ";
      }  
      $insertString = substr($insertString, 0, strlen($insertString)-2) . ')';   
      if ($debug === true) {
        echo $insertString;
        die(); 
      } else {
        $this->execute($insertString);
      }
      break;
      case 'update':
      $updateString ="";
      $updateString = 'UPDATE ' . $tableName . ' SET ';
      foreach ($tableData as $key => $value) {
        $bindVarValue = $this->getBindVarValue($value['value'], $value['type']);
        $updateString .= $value['fieldName'] . '=' . $bindVarValue . ', ';  
      }
      $updateString = substr($updateString, 0, strlen($updateString)-2);
      if ($performFilter != '') {
        $updateString .= ' WHERE ' . $performFilter;
      }
      if ($debug === true) {
        echo $updateString;
        die(); 
      } else {
        $this->execute($updateString);
      }
      break;
    }
  }
  function getBindVarValue($value, $type) {
    $typeArray = explode(':',$type);
    $type = $typeArray[0];
    switch ($type) {
      case 'csv':
        return $value;
      break;
      case 'passthru':
        return $value;
      break;
      case 'float':
        return (!zen_not_null($value) || $value=='' || $value == 0) ? 0 : $value;
      break;
      case 'integer':
        return (int)$value;
      break;
      case 'string':
        if (isset($typeArray[1])) {
          $regexp = $typeArray[1];
        }
        return '\'' . $this->prepare_input($value) . '\'';
      break;
      case 'noquotestring':
        return $this->prepare_input($value);
      break;
      case 'currency':
        return '\'' . $this->prepare_input($value) . '\'';
      break;
      case 'date':
        return '\'' . $this->prepare_input($value) . '\'';
      break;
      case 'enum':
        if (isset($typeArray[1])) {
          $enumArray = explode('|', $typeArray[1]);
        }
        return '\'' . $this->prepare_input($value) . '\'';
      default:
      die('var-type undefined: ' . $type . '('.$value.')');
    }
  }
/** 
 * method to do bind variables to a query
**/
  function bindVars($sql, $bindVarString, $bindVarValue, $bindVarType, $debug = false) {
    $bindVarTypeArray = explode(':', $bindVarType);
    $sqlNew = $this->getBindVarValue($bindVarValue, $bindVarType);
    $sqlNew = str_replace($bindVarString, $sqlNew, $sql);
    return $sqlNew;
  }  
  
  function prepareInput($string) {
    return @mysql_real_escape_string($string);
  }
}

class queryFactoryResult {

  function queryFactoryResult() {
    $this->is_cached = false;
  }

  function MoveNext() {
    global $zc_cache;
    $this->cursor++;
    if ($this->is_cached) {
      if ($this->cursor >= sizeof($this->result)) {
        $this->EOF = true;
      } else {
        while(list($key, $value) = each($this->result[$this->cursor])) {
	  $this->fields[$key] = $value;
	}
      }
    } else {
      $zp_result_array = @mysql_fetch_array($this->resource);
      if (!$zp_result_array) {
        $this->EOF = true;
      } else {
        while (list($key, $value) = each($zp_result_array)) {
          if (!ereg('^[0-9]', $key)) {
            $this->fields[$key] = $value;
          }
        }
      }
    }
  }

  function MoveNextRandom() {
    $this->cursor++;
    if ($this->cursor < $this->Limit) {
      $zp_result_array = $this->result[$this->result_random[$this->cursor]];
      while (list($key, $value) = each($zp_result_array)) {
        if (!ereg('^[0-9]', $key)) {
          $this->fields[$key] = $value;
	}
      }
    } else {
      $this->EOF = true;
    }
  }

    function RecordCount() {
    return @mysql_num_rows($this->resource);
  }

  function Move($zp_row) {
    global $db;
    if (@mysql_data_seek($this->resource, $zp_row)) {
      $zp_result_array = @mysql_fetch_array($this->resource);
        while (list($key, $value) = each($zp_result_array)) {
          $this->fields[$key] = $value;
        }
      @mysql_data_seek($this->resource, $zp_row);
      $this->EOF = false;
      return;
    } else {
      $this->EOF = true;
      $db->set_error(mysql_errno(),mysql_error());
    }
  }
}

class queryFactoryMeta {

  function queryFactoryMeta($zp_field, $zp_res) {
    $this->type = @mysql_field_type($zp_res, $zp_field);
    $this->max_length = @mysql_field_len($zp_res, $zp_field);
  }
}
?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产77777蜜臀| 正在播放一区二区| 欧美日韩精品一二三区| 久久久国际精品| 日本不卡一区二区三区| 色综合一个色综合| 精品国产乱码久久| 午夜电影一区二区三区| 色综合色狠狠天天综合色| 26uuu欧美日本| 麻豆精品视频在线观看视频| 一本一本大道香蕉久在线精品| 国产欧美精品在线观看| 美女性感视频久久| 在线电影国产精品| 一区二区三区四区中文字幕| 不卡一区中文字幕| 国产欧美一区二区在线| 国产一区高清在线| 亚洲主播在线播放| 色婷婷av一区二区三区gif| 中文字幕成人网| 成人精品小蝌蚪| 国产精品精品国产色婷婷| 国产精品小仙女| 国产日韩欧美在线一区| 国产电影一区在线| 国产人成一区二区三区影院| 国产91精品在线观看| 久久蜜桃一区二区| 福利一区二区在线观看| 久久精品日产第一区二区三区高清版| 韩国精品免费视频| 久久综合色之久久综合| 粉嫩aⅴ一区二区三区四区| 久久久久国产精品免费免费搜索| 国产福利不卡视频| 日本一区二区三区高清不卡| 国产精品 欧美精品| 国产精品污www在线观看| a美女胸又www黄视频久久| 国产精品福利一区| 欧美色网一区二区| 五月天一区二区| 亚洲精品欧美专区| 欧美无砖砖区免费| 日韩电影一区二区三区四区| 91精品国产综合久久香蕉麻豆| 美女网站一区二区| 久久婷婷色综合| 99久久精品国产麻豆演员表| 一区二区欧美视频| 欧美一区二区三区视频在线观看| 九九**精品视频免费播放| 国产无人区一区二区三区| 91在线视频播放地址| 亚洲一级在线观看| 精品久久人人做人人爰| caoporn国产精品| 日韩精品一级中文字幕精品视频免费观看 | 欧美成人vps| 高清免费成人av| 亚洲电影中文字幕在线观看| 2020国产精品自拍| 99久久99久久精品国产片果冻| 亚洲一区二区三区四区五区黄| 精品国产伦一区二区三区观看方式 | 国产女同性恋一区二区| 在线观看视频一区二区欧美日韩| 久久丁香综合五月国产三级网站| 国产精品久久久久影院| 欧美二区三区91| 99久久精品国产一区| 日本不卡在线视频| 亚洲精品免费在线| 久久综合99re88久久爱| 欧美色视频在线观看| 成人在线综合网| 麻豆国产欧美日韩综合精品二区 | 国产色婷婷亚洲99精品小说| 欧美体内she精高潮| 国产黄色成人av| 青青草国产成人av片免费| 亚洲六月丁香色婷婷综合久久 | 日韩国产精品91| 亚洲色图第一区| 久久久久久久综合色一本| 欧美日韩1区2区| 在线视频综合导航| 成人免费毛片片v| 韩国精品在线观看| 麻豆一区二区三| 偷拍日韩校园综合在线| 亚洲欧美日韩在线不卡| 国产日韩欧美精品综合| 日韩久久久精品| 这里只有精品99re| 欧美日韩久久久| 色婷婷精品大视频在线蜜桃视频| 国产成人免费视频网站高清观看视频 | 亚洲一区二区三区四区五区黄| 日本一区二区三区久久久久久久久不 | 成人激情电影免费在线观看| 韩国女主播成人在线| 美女任你摸久久| 久久99久久久欧美国产| 男男成人高潮片免费网站| 日韩影视精彩在线| 日本麻豆一区二区三区视频| 色婷婷狠狠综合| 欧日韩精品视频| 欧美日韩一区二区三区不卡| 在线观看亚洲成人| 欧美日韩高清影院| 制服丝袜亚洲精品中文字幕| 555www色欧美视频| 欧美精品乱码久久久久久按摩 | 国产一区二区毛片| 国产一区二区三区在线观看免费视频| 久久精品国产999大香线蕉| 精品一区二区三区在线视频| 国产成人精品免费视频网站| 成人免费高清在线| 色美美综合视频| 欧美日韩精品二区第二页| 欧美一区日本一区韩国一区| 精品国产一区二区三区忘忧草| 久久久美女毛片| 亚洲欧美区自拍先锋| 亚洲综合清纯丝袜自拍| 人人狠狠综合久久亚洲| 国内精品久久久久影院一蜜桃| 国产成人夜色高潮福利影视| 91视频在线观看| 67194成人在线观看| 久久这里都是精品| 自拍偷自拍亚洲精品播放| 亚洲国产精品一区二区www在线| 欧美aaa在线| 成人动漫一区二区| 欧美日韩一区高清| 国产色婷婷亚洲99精品小说| 亚洲一二三四区不卡| 久久福利视频一区二区| jiyouzz国产精品久久| 91精品国产综合久久久久| 久久精品欧美日韩| 亚洲1区2区3区4区| 国产成人午夜精品影院观看视频 | 精品久久久久久久一区二区蜜臀| 国产欧美日韩在线观看| 亚洲午夜激情网站| 国产福利一区在线| 欧美乱妇一区二区三区不卡视频| 久久精品视频网| 午夜成人免费视频| 成人午夜碰碰视频| 欧美一区二区三区婷婷月色| 中文字幕视频一区| 久久不见久久见免费视频7 | 午夜精品久久久久久久久| 国产99久久久精品| 日韩欧美国产麻豆| 亚洲男人的天堂一区二区| 国产毛片精品一区| 欧美日韩国产bt| 亚洲视频一区在线| 国产盗摄女厕一区二区三区| 51精品秘密在线观看| 亚洲免费在线视频| 国产成a人亚洲精品| 精品毛片乱码1区2区3区 | 日韩视频在线观看一区二区| 亚洲欧美日韩中文播放| 国产91精品欧美| 亚洲高清视频中文字幕| 成人午夜在线免费| 久久久久国产精品厨房| 亚洲高清免费视频| 26uuuu精品一区二区| 久久国产综合精品| 亚洲天堂成人在线观看| 极品少妇xxxx精品少妇偷拍| 欧美福利电影网| 亚洲一区二区三区四区五区黄 | 67194成人在线观看| 亚洲人成网站色在线观看| 丁香天五香天堂综合| 国产清纯白嫩初高生在线观看91| 国产在线视频不卡二| 欧美精品一区二区三区久久久| 青青草国产精品亚洲专区无| 欧美一区二区免费观在线| 日本vs亚洲vs韩国一区三区| 日韩欧美美女一区二区三区| 蜜桃视频在线观看一区二区| 欧美一区二区国产| 美女久久久精品| 国产喂奶挤奶一区二区三区| 成人激情免费电影网址|