我将 CodeIgniter 与 GroceryCrud 一起使用, 当我尝试进行搜索时,响应是 mysql 错误。
错误包含下一条消息:
Error Number: 1064</p><p>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 'both last_action_date LIKE '%11%'
both package_id LIKE '%11%'
both at line 6
这是相关查询的一部分
...FROM (`users`)
LEFT JOIN `users` as j9e598a93 ON `j9e598a93`.`id` = `users`.`accountant_id`
LEFT JOIN `users` as j0b70ca4c ON `j0b70ca4c`.`id` = `users`.`affiliate_id`
WHERE `id` LIKE '%11%'
both `last_action_date` LIKE '%11%'
both `package_id` LIKE '%11%'
我不熟悉“BOTH”mysql 运算符,我找不到它。
有人认识这个运营商吗? 它真的存在还是 GroceryCrud 错误?
最佳答案
does anyone knows this operator?
在您的查询中,假定 BOTH
标记用作中缀 bool 运算符。 mysql 中没有这样的定义,因此 mysql 查询解析器无法解析查询。
is it really exists or it's a GroceryCrud bug?
肯定是生成了错误的SQL查询导致的bug。
关于php - 有没有mysql运算符 `both`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26705680/