ecshop/includes/cls_mysql.php

公用类库

class cls_mysql

  • function cls_mysql($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'gbk', $pconnect = 0, $quiet = 0)
  • connect($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'utf8', $pconnect = 0, $quiet = 0) 对 PHP 4.2 以下的版本进行随机数函数的初始化工作, 如果mysql 版本是 4.1+ 以上,需要对字符集进行初始化,选择数据库 dbhash, version
  • $mysql_config_cache_file_time, $timeline ,$timezone ,$platform
  • select_database($dbname)
  • set_mysql_charset($charset)
  • fetch_array($query, $result_type = MYSQL_ASSOC)
  • query($sql, $type = '') 当前的时间大于类初始化时间的时候,自动执行 ping 这个自动重新连接操作, DEBUG_MODE & 8
  • affected_rows()
  • error()
  • errno()
  • result($query, $row)
  • num_rows($query)
  • num_fields($query)
  • free_result($query)
  • insert_id()
  • fetchRow($query)
  • fetch_fields($query)
  • version()
  • ping()
  • escape_string($unescaped_string)
  • close()
  • ErrorMsg($message = '', $sql = '')

仿真 Adodb 函数

  • selectLimit($sql, $num, $start = 0)
  • getOne($sql, $limited = false)
  • getOneCached($sql, $cached = 'FILEFIRST')
  • getAll($sql)
  • getAllCached($sql, $cached = 'FILEFIRST')
  • getRow($sql, $limited = false)
  • getRowCached($sql, $cached = 'FILEFIRST')
  • getCol($sql)
  • getColCached($sql, $cached = 'FILEFIRST')
  • autoExecute($table, $field_values, $mode = 'INSERT', $where = '', $querymode = '')
  • autoReplace($table, $field_values, $update_values, $where = '', $querymode = '')
  • setMaxCacheTime($second)
  • getMaxCacheTime()
  • getSqlCacheData($sql, $cached = '')
  • setSqlCacheData($result, $data)
  • table_lastupdate($tables)
  • get_table_name($query_item)
  • set_disable_cache_tables($tables) 设置不允许进行缓存的表