SELECT * FROM com_product_extend WHERE pid = LIMIT 1
执行错误: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1
- /data/project/duoduoyin/php/SpeedPHP/Drivers/mysqli.php on line 62
57.
{
58.
$this->arrSql[] = $sql;
59.
if( $result = mysqli_query($this->conn, $sql) ){
60.
return $result;
61.
}else{
62.
63.
spError("{$sql}<br />执行错误: " . mysqli_error($this->conn));
}
64.
}
65.
66.
/**
67.
* 返回影响行数
- /data/project/duoduoyin/php/SpeedPHP/Drivers/mysqli.php on line 26
21.
*
22.
* @param sql 执行的SQL语句
23.
*/
24.
public function getArray($sql)
25.
{
26.
27.
if( ! $result = $this->exec($sql) )return array();
if( ! mysqli_num_rows($result) )return array();
28.
$rows = array();
29.
while($rows[] = mysqli_fetch_array($result, MYSQLI_ASSOC)){}
30.
mysqli_free_result($result);
31.
array_pop($rows);
- /data/project/duoduoyin/php/SpeedPHP/Core/spModel.php on line 116
111.
}else{
112.
//$sort = "ORDER BY {$this->pk}"; //注释by lanying 使用默认排序提高查询性能
113.
}
114.
$sql = "SELECT {$fields} FROM {$this->tbl_name} {$where} {$sort}";
115.
if(null != $limit)$sql = $this->_db->setlimit($sql, $limit);
116.
117.
return $this->_db->getArray($sql);
}
118.
119.
/**
120.
* 不清缓存findALL函数
121.
*/
- /data/project/duoduoyin/php/SpeedPHP/Core/spModel.php on line 70
65.
* @param sort 排序,等同于“ORDER BY ”
66.
* @param fields 返回的字段范围,默认为返回全部字段的值
67.
*/
68.
public function find($conditions = null, $sort = null, $fields = null)
69.
{
70.
71.
if( $record = $this->findAll($conditions, $sort, $fields, 1) ){
return array_pop($record);
72.
}else{
73.
return FALSE;
74.
}
75.
}
- /data/project/duoduoyin/php/model/m_product_extend.php on line 18
13.
* @DateTime 2017-08-15T14:50:59+0800
14.
* @param int $pid [分类的id]
15.
* @return array|false
16.
*/
17.
public function getProductExtend($pid){
18.
19.
$extendData = $this->find("pid = {$pid} ");
if (!$extendData) {
20.
return false;
21.
}
22.
$data = array();
23.
//尺寸数据
- /data/project/duoduoyin/php/SpeedPHP/Core/spModel.php on line 679
674.
$cache_id .= md5(json_encode($func_args[0]));
675.
}
676.
$cache_id .= md5(json_encode($func_args));
677.
}
678.
if( $cache_file = spAccess('r', "sp_cache_{$cache_id}") )return unserialize( $cache_file );
679.
680.
return $this->cache_obj($cache_id, call_user_func_array(array($this->model_obj, $func_name), $func_args), $this->input_args[0]);
}
681.
/**
682.
* 执行spModel子类对象的方法,并对返回结果进行缓存。
683.
*
684.
* @param obj 引用的spModel子类对象
- /data/project/duoduoyin/php/controller/main.php on line 380
375.
$this->goodsData = $goodsData;
376.
$this->product = $product;
377.
$this->productInfo = $productInfo = spClass('m_product')->spCache()->find("product = '{$product}'");
378.
$this->productData = spClass('m_product')->spCache()->getClassifyData();
379.
$this->colorData = array('fffcfc','fffefa','fafffe');
380.
381.
$extend = spClass('m_product_extend')->spCache()->getProductExtend($productInfo['id']);
if ($extend !== false) {
382.
$this->jsonData = $extend['data'];
383.
$extend['extendData']['sizeDescription'] = str_replace('</br>', '', $extend['extendData']['sizeDescription']);
384.
$this->extendData = $extend['extendData'];
385.
}
- /data/project/duoduoyin/php/SpeedPHP/spFunctions.php on line 34
29.
header('location: /main/notfound.html');exit();
30.
eval($GLOBALS['G_SP']["dispatcher_error"]);
31.
exit;
32.
}
33.
// 路由并执行用户代码
34.
35.
$handle_controller->$__action();
// 控制器程序运行完毕,进行模板的自动输出
36.
if(FALSE != $GLOBALS['G_SP']['view']['auto_display']){
37.
$__tplname = $__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
38.
$__action.$GLOBALS['G_SP']['view']['auto_display_suffix']; // 拼装模板路径
39.
$handle_controller->auto_display($__tplname);
- /data/project/duoduoyin/php/index.php on line 3
1.
<?php
2.
require(SP_PATH."/SpeedPHP.php");
3.
spRun();
- /data/project/duoduoyin/web/pc/index.php on line 4
1.
<?php
2.
header('Access-Control-Allow-Origin:*');
3.
$spConfig = require(dirname(dirname(__DIR__)) . '/config/config-pc.php');
4.
require(BASE_PATH."/index.php");