[10501] PDOException in Connection.php line 385

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 ')' at line 1

  1. $this->PDOStatement->execute();
  2. // 调试结束
  3. $this->debug(false, '', $master);
  4. // 返回结果集
  5. return $this->getResult($pdo, $procedure);
  6. } catch (\PDOException $e) {
  7. if ($this->isBreak($e)) {
  8. return $this->close()->query($sql, $bind, $master, $pdo);
  9. }
  10. throw new PDOException($e, $this->config, $this->getLastsql());
  11. } catch (\Throwable $e) {
  12. if ($this->isBreak($e)) {
  13. return $this->close()->query($sql, $bind, $master, $pdo);
  14. }
  15. throw $e;
  16. } catch (\Exception $e) {
  17. if ($this->isBreak($e)) {
  18. return $this->close()->query($sql, $bind, $master, $pdo);
  19. }

Call Stack

  1. in Connection.php line 385
  2. at Connection->query('SELECT `id` FROM `cm...', [], false, false) in Query.php line 255
  3. at Query->query('SELECT `id` FROM `cm...', [], false, false) in Query.php line 2523
  4. at Query->select() in PortalCategoryModel.php line 180
  5. at PortalCategoryModel->getCategoryChildId(null) in ListController.php line 52
  6. at ListController->index()
  7. at ReflectionMethod->invokeArgs(object(ListController), []) in App.php line 343
  8. at App::invokeMethod([object(ListController), 'index'], []) in App.php line 621
  9. at App::module(['portal', 'list', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  10. at App::exec(['type' => 'module', 'module' => ['portal', 'list', 'index']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  11. at App::run() in index.php line 67

Exception Datas

PDO Error Info
SQLSTATE 42000
Driver Error Code 1064
Driver Error Message 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 ')' at line 1
Database Status
Error Code 10501
Error Message 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 ')' at line 1
Error SQL SELECT `id` FROM `cmf_portal_category` WHERE ( parent_id= )
Database Config
type mysql
hostname 127.0.0.1
database klaritycare_db2
hostport 3306
dsn
params []
charset utf8
prefix cmf_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
result_type 2
resultset_type collection
auto_timestamp false
datetime_format Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false
authcode 3WpL6SOZ8s5r1poMQc

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
SCRIPT_NAME
/index.php
REQUEST_URI
/portal/list/index/id/106
QUERY_STRING
s=portal/list/index/id/106
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REDIRECT_QUERY_STRING
s=portal/list/index/id/106
REDIRECT_URL
/portal/list/index/id/106
REMOTE_PORT
49226
SCRIPT_FILENAME
/www/wwwroot/183.60.156.97/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/183.60.156.97/
CONTEXT_PREFIX
REQUEST_SCHEME
https
DOCUMENT_ROOT
/www/wwwroot/183.60.156.97/
REMOTE_ADDR
120.89.68.82
SERVER_PORT
443
SERVER_ADDR
120.240.103.247
SERVER_NAME
funkyasamonkey.com
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
<address>Apache Server at funkyasamonkey.com Port 443</address>
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)
HTTP_HOST
funkyasamonkey.com
proxy-nokeepalive
1
SSL_TLS_SNI
funkyasamonkey.com
HTTPS
on
REDIRECT_STATUS
200
REDIRECT_SSL_TLS_SNI
funkyasamonkey.com
REDIRECT_HTTPS
on
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1783026957.5019
REQUEST_TIME
1783026957
PATH_INFO
portal/list/index/id/106
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
true
CMF_ROOT
/www/wwwroot/183.60.156.97/
APP_PATH
/www/wwwroot/183.60.156.97/app/
UPLOAD_PATH
/www/wwwroot/183.60.156.97/upload/
CMF_PATH
/www/wwwroot/183.60.156.97/simplewind/cmf/
PLUGINS_PATH
/www/wwwroot/183.60.156.97/plugins/
EXTEND_PATH
/www/wwwroot/183.60.156.97/simplewind/extend/
VENDOR_PATH
/www/wwwroot/183.60.156.97/simplewind/vendor/
RUNTIME_PATH
/www/wwwroot/183.60.156.97/data/runtime/
THINKCMF_VERSION
5.0.170927
SO
is_top DESC,list_order DESC,published_time DESC,post_id DESC
GSO
is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC
TMPLSO
order:is_top DESC,list_order DESC,published_time DESC,post_id DESC;
TMPLGSO
order:is_top DESC,category_relate.list_order DESC,published_time DESC,goods_id DESC;
WEB_ROOT
/www/wwwroot/183.60.156.97/
THINK_VERSION
5.0.24
THINK_START_TIME
1783026957.5023
THINK_START_MEM
421568
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/183.60.156.97/simplewind/thinkphp/
LIB_PATH
/www/wwwroot/183.60.156.97/simplewind/thinkphp/library/
CORE_PATH
/www/wwwroot/183.60.156.97/simplewind/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/183.60.156.97/simplewind/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/183.60.156.97/
LOG_PATH
/www/wwwroot/183.60.156.97/data/runtime/log/
CACHE_PATH
/www/wwwroot/183.60.156.97/data/runtime/cache/
TEMP_PATH
/www/wwwroot/183.60.156.97/data/runtime/temp/
CONF_PATH
/www/wwwroot/183.60.156.97/app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/www/wwwroot/183.60.156.97/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.1
LOCATION_SERVICE_PRODUCT_NAME
Location
LOCATION_SERVICE_DOMAIN
location.aliyuncs.com
LOCATION_SERVICE_VERSION
2015-06-12
LOCATION_SERVICE_DESCRIBE_ENDPOINT_ACTION
DescribeEndpoints
LOCATION_SERVICE_REGION
cn-hangzhou
CACHE_EXPIRE_TIME
3600
ENABLE_HTTP_PROXY
false
HTTP_PROXY_IP
127.0.0.1
HTTP_PROXY_PORT
8888
IS_WECHAT_FALSE
1
IS_WECHAT_TRUE
2