[10501] PDOException in Connection.php line 687

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

Call Stack

  1. in Connection.php line 687
  2. at Connection->query('SELECT COUNT(*) AS t...', ['ThinkBind_1_' => [1, 2]], false, true) in Connection.php line 1299
  3. at Connection->value(object(Query), ['COUNT(*) AS tp_count'], 0, false) in Connection.php line 1327
  4. at Connection->aggregate(object(Query), 'COUNT', 'COUNT(*) AS tp_count') in Query.php line 623
  5. at Query->aggregate('COUNT', '*', true) in Query.php line 658
  6. at Query->count() in Query.php line 1783
  7. at Query->paginate(8, false, ['type' => 'bootstrap', 'var_page' => 'page', 'list_rows' => 15, ...]) in index.php line 36
  8. at index->run(['route_param' => ['a' => '1', 'b' => '重量訓練']]) in Error.php line 88
  9. at Error->routeRun('Post', 'index', ['a' => '1', 'b' => '重量訓練']) in Error.php line 36
  10. at Error->run() in Error.php line 100
  11. at Error->_empty()
  12. at ReflectionMethod->invokeArgs(object(Error), []) in Container.php line 395
  13. at Container->invokeReflectMethod(object(Error), object(ReflectionMethod), ['重量訓練']) in Module.php line 132
  14. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  18. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  19. at Module->exec() in Dispatch.php line 168
  20. at Dispatch->run() in App.php line 432
  21. at App->think\{closure}(object(Request), object(Closure), null)
  22. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  23. at Middleware->think\{closure}(object(Request))
  24. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  25. at Middleware->dispatch(object(Request)) in App.php line 435
  26. at App->run() in index.php line 21

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 COUNT(*) AS tp_count FROM `tp_news` `A` INNER JOIN `tp_auth_admin` `B` ON `A`.`admin_id`=`B`.`id` INNER JOIN `tp_news_type` `C` ON `A`.`type_id`=`C`.`id` WHERE `A`.`status` = '1' AND `A`.`type_id` =
Database Config
type mysql
hostname 127.0.0.1
database www_doublefitnes
hostport 3306
dsn
params []
charset utf8
prefix tp_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
resultset_type array
auto_timestamp true
datetime_format Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false
break_match_str []

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookies
31ed409318ae1c57a71dcb03b09f1e96 1
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.doublefitness.com.tw
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.doublefitness.com.tw
SERVER_PORT 443
SERVER_ADDR 61.216.114.55
REMOTE_PORT 33830
REMOTE_ADDR 34.226.141.207
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/www.doublefitness.com.tw
DOCUMENT_URI /index.php
REQUEST_URI /category/%e9%87%8d%e9%87%8f%e8%a8%93%e7%b7%b4/
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/category/%E9%87%8D%E9%87%8F%E8%A8%93%E7%B7%B4/
SCRIPT_FILENAME /www/wwwroot/www.doublefitness.com.tw/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711626327.5049
REQUEST_TIME 1711626327
Environment Variablesempty
ThinkPHP Constants
APP_PATH /www/wwwroot/www.doublefitness.com.tw/app/
__EDITION__ v1.0.1
__ADMIN__ /public/admin
__INDEX__ /public/index
__PULOADS__ /public/data/uploads
ROOT_PATH /www/wwwroot/www.doublefitness.com.tw
PHP_FLOAT_DIG 15
PHP_FLOAT_EPSILON 2.2204460492503E-16
PHP_FLOAT_MIN 2.2250738585072E-308
PHP_FLOAT_MAX 1.7976931348623E+308
PHP_OS_FAMILY Linux