老师,我在4.1搭建前台模块时遇到如下问题,请问是哪里出了问题?
来源:4-1 前端模块页面搭建

LCHWSX
2019-09-16
[42000] PDOException in Mysql.php line 60
SQLSTATE[42000]: Syntax error or access violation: 1064 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 ‘cityimooc_o2o' at line 1 { $this->initConnect(true); list($tableName) = explode(' ', $tableName); if (strpos($tableName, '.')) { $tableName = str_replace('.', '
.', $tableName); } $sql = 'SHOW COLUMNS FROM
’ . $tableName . ‘imooc_o2o’;
// 调试开始
$this->debug(true);
$pdo = this−>linkID−>query(this->linkID->query(this−>linkID−>query(sql);
// 调试结束
$this->debug(false, $sql);
$result = $pdo->fetchAll(PDO::FETCH_ASSOC);
info=[];if(info = [];
if (info=[];if(result) {
foreach ($result as $key => $val) {
val=arraychangekeycase(val = array_change_key_case(val=arraychangekeycase(val);
info[info[info[val[‘field’]] = [
‘name’ => $val[‘field’],
Call Stack
in Mysql.php line 60
at PDO->query(‘SHOW COLUMNS FROM `c…’) in Mysql.php line 60
at Mysql->getFields(‘city’) in E:DEMOimooc_o2ocity hinkphplibrary hinkdbQuery.php line 1424
at Query->getTableInfo(‘city’, ‘type’) in Query.php line 1472
at Query->getFieldsType([‘where’ => [‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], ‘order’ => [‘id’ => ‘desc’], ‘table’ => ‘city’, …]) in Query.php line 1478
at Query->getFieldsBind([‘where’ => [‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], ‘order’ => [‘id’ => ‘desc’], ‘table’ => ‘city’, …]) in Builder.php line 230
at Builder->buildWhere([‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], [‘where’ => [‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], ‘order’ => [‘id’ => ‘desc’], ‘table’ => ‘city’, …]) in Builder.php line 208
at Builder->parseWhere([‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], [‘where’ => [‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], ‘order’ => [‘id’ => ‘desc’], ‘table’ => ‘city’, …]) in Builder.php line 600
at Builder->select([‘where’ => [‘AND’ => [‘status’ => 1, ‘parent_id’ => [‘gt’, 0]]], ‘order’ => [‘id’ => ‘desc’], ‘table’ => ‘city’, …]) in Query.php line 1931
at Query->select() in City.php line 35
at City->getNormalCitys() in Base.php line 12
at Base->_initialize() in Controller.php line 53
at Controller->__construct(object(Request))
at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 251
at App::invokeClass(‘appindexcontroller…’) in Loader.php line 410
at Loader::controller(‘index’, ‘controller’, false, ‘Error’) in App.php line 375
at App::module([’’, null, null], [‘app_namespace’ => ‘app’, ‘app_debug’ => true, ‘app_trace’ => false, …], null) in App.php line 140
at App::run() in start.php line 18
at require(‘E:DEMOimooc_o2ocit…’) in index.php line 17
2回答
-
LCHWSX
提问者
2019-09-16
老师,是这个数据库连接配置吗012019-09-16 -
singwa
2019-09-16
您好。您这个应该有问题,应该在你那数据库配置有关
辛苦把您数据库配置 截图发我看看。
00
相似问题