[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 'or fid = or other_category LIKE "%,,%") ) LIMIT 1' 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 COUNT(*) AS t...', [], false, true) in Query.php line 255
  3. at Query->query('SELECT COUNT(*) AS t...', [], false, true) in Query.php line 2470
  4. at Query->getPdo() in Query.php line 441
  5. at Query->value('COUNT(*) AS tp_count', 0, true) in Query.php line 576
  6. at Query->aggregate('COUNT', '*', true) in Query.php line 551
  7. at Query->count() in Query.php line 1484
  8. at Query->paginate(24) in Category.php line 41
  9. at Category->index()
  10. at ReflectionMethod->invokeArgs(object(Category), []) in App.php line 343
  11. at App::invokeMethod([object(Category), 'index'], []) in App.php line 611
  12. at App::module([null, 'Category', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  13. at App::exec(['type' => 'module', 'module' => [null, 'Category', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  14. at App::run() in start.php line 19
  15. at require('/www/wwwroot/storeza...') in index.php line 19

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 'or fid = or other_category LIKE "%,,%") ) LIMIT 1' 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 'or fid = or other_category LIKE "%,,%") ) LIMIT 1' at line 1
Error SQL SELECT COUNT(*) AS tp_count FROM `yhr_view_products` WHERE ( is_del = 1 and status = 1 and is_sale = 0 and (category_id = or fid = or other_category LIKE "%,,%") ) LIMIT 1
Database Config
type mysql
hostname 127.0.0.1
database storezaka
hostport 3306
dsn
params []
charset utf8
prefix yhr_
debug true
deploy 0
rw_separate false
master_num 1
slave_no
read_master false
fields_strict true
result_type 2
resultset_type array
auto_timestamp false
datetime_format Y-m-d H:i:s
sql_explain false
builder
query \think\db\Query
break_reconnect false

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
REDIRECT_HTTPS
on
REDIRECT_SSL_TLS_SNI
www.storezaka.com
REDIRECT_HTTP2
on
REDIRECT_H2PUSH
off
REDIRECT_H2_PUSH
off
REDIRECT_H2_PUSHED
REDIRECT_H2_PUSHED_ON
REDIRECT_H2_STREAM_ID
3
REDIRECT_H2_STREAM_TAG
27132-176-3
REDIRECT_STATUS
200
HTTPS
on
SSL_TLS_SNI
www.storezaka.com
HTTP2
on
H2PUSH
off
H2_PUSH
off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID
3
H2_STREAM_TAG
27132-176-3
proxy-nokeepalive
1
HTTP_ACCEPT
*/*
HTTP_USER_AGENT
claudebot
HTTP_HOST
www.storezaka.com
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH
/www/server/apache/lib
SERVER_SIGNATURE
<address>Apache Server at www.storezaka.com Port 443</address>
SERVER_SOFTWARE
Apache
SERVER_NAME
www.storezaka.com
SERVER_ADDR
10.203.0.7
SERVER_PORT
443
REMOTE_ADDR
44.206.248.122
DOCUMENT_ROOT
/www/wwwroot/storezaka.com/public
REQUEST_SCHEME
https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/storezaka.com/public
SERVER_ADMIN
webmaster@example.com
SCRIPT_FILENAME
/www/wwwroot/storezaka.com/public/index.php
REMOTE_PORT
34592
REDIRECT_URL
/category/earphone-case/
GATEWAY_INTERFACE
CGI/1.1
SERVER_PROTOCOL
HTTP/2.0
REQUEST_METHOD
GET
QUERY_STRING
REQUEST_URI
/category/earphone-case/
SCRIPT_NAME
/index.php
PATH_INFO
/category/earphone-case/
PATH_TRANSLATED
redirect:/index.php/category/earphone-case//earphone-case/
PHP_SELF
/index.php/category/earphone-case/
REQUEST_TIME_FLOAT
1710816179.6763
REQUEST_TIME
1710816179
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/storezaka.com/public/../app/
THINK_VERSION
5.0.23
THINK_START_TIME
1710816179.6768
THINK_START_MEM
272320
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/storezaka.com/thinkphp/
LIB_PATH
/www/wwwroot/storezaka.com/thinkphp/library/
CORE_PATH
/www/wwwroot/storezaka.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/storezaka.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/storezaka.com/
EXTEND_PATH
/www/wwwroot/storezaka.com/extend/
VENDOR_PATH
/www/wwwroot/storezaka.com/vendor/
RUNTIME_PATH
/www/wwwroot/storezaka.com/runtime/
LOG_PATH
/www/wwwroot/storezaka.com/runtime/log/
CACHE_PATH
/www/wwwroot/storezaka.com/runtime/cache/
TEMP_PATH
/www/wwwroot/storezaka.com/runtime/temp/
CONF_PATH
/www/wwwroot/storezaka.com/public/../app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false