77范文网 - 专业文章范例文档资料分享平台

ecshop适应PHP7的修改(2)

来源:网络收集 时间:2018-11-25 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

functionquery($sql, $type = '') {

if ($this->link_id === NULL) {

$this->connect($this->settings['dbhost'], $this->settings['dbuser'], $this->settings['dbpw'], $this->settings['dbname'], $this->settings['charset'], $this->settings['pconnect']); $this->settings = array(); }

if ($this->queryCount++ <= 99) {

$this->queryLog[] = $sql; }

if ($this->queryTime == '') {

if (PHP_VERSION>= '5.0.0') {

$this->queryTime = microtime(true); } else

{

$this->queryTime = microtime(); } }

/* 当当前的时间大于类初始化时间的时候,自动执行 ping 这个自动重新连接操作 */ if (time() >$this->starttime + 1) {

$this->link_id->ping(); }

if(!($query = $this->link_id->query($sql)) &&$type != 'SILENT') {

$this->error_message[]['message'] = 'MySQL Query Error'; $this->error_message[]['sql'] = $sql;

$this->error_message[]['error'] = $this->link_id->error; $this->error_message[]['errno'] = $this->link_id->errno;

$this->ErrorMsg();

returnfalse; }

if (defined('DEBUG_MODE') && (DEBUG_MODE & 8) == 8)

{

$logfilename = $this->root_path . DATA_DIR . '/mysql_query_' .$this->dbhash . '_' . date('Y_m_d') . '.log'; $str = $sql . \

if (PHP_VERSION>= '5.0') {

file_put_contents($logfilename, $str, FILE_APPEND); } else

{

$fp = @fopen($logfilename, 'ab+'); if ($fp)

{ fwrite($fp, $str); fclose($fp); } } }

return$query; }

functionaffected_rows() {

return$this->link_id->affected_rows; }

functionerror() {

return$this->link_id->error; }

functionerrno() {

return$this->link_id->errno; }

functionresult($query, $row) {

$query->data_seek($row); $result = $query->fetch_row(); $query->free(); return$result; }

functionnum_rows($query) {

return$query->num_rows; }

functionnum_fields($query) {

return$this->link_id->field_count; }

functionfree_result($query) {

return$query->free(); }

functioninsert_id() {

return$this->link_id->insert_id; }

functionfetchRow($query) {

return$query->fetch_assoc(); }

functionfetch_fields($query) {

return$query->fetch_field(); }

functionversion() {

return$this->version; }

functionping() {

return$this->link_id->ping(); }

functionescape_string($unescaped_string) {

return$this->link_id->real_escape_string($unescaped_string);

}

functionclose() {

return$this->link_id->close(); }

functionErrorMsg($message = '', $sql = '') { if ($message) {

echo \$message\\n\\n

\//print('

href=\QL server on\ } else {

echo \print_r($this->error_message);

//echo \

$this->error_message[3]['errno'] . \target='_blank'>http://faq.comsenz.com/\ } exit; }

/* 仿真Adodb函数 */

functionselectLimit($sql, $num, $start = 0) { if ($start == 0) {

$sql .= ' LIMIT ' . $num; } else {

$sql .= ' LIMIT ' . $start . ', ' . $num; }

return$this->query($sql); }

functiongetOne($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 { returnfalse; } }

functiongetOneCached($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']; } }

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库ecshop适应PHP7的修改(2)在线全文阅读。

ecshop适应PHP7的修改(2).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/309530.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: