Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there mysql operator `both`

I am using CodeIgniter with GroceryCrud, when I am tring to do a search the response is mysql error.

the error contains the next message:
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

and here is part of the relevant query

...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%'

I am not familiar with the "BOTH" mysql operator and I could not find it.

does anyone knows this operator? is it really exists or it's a GroceryCrud bug?

like image 339
Wazime Avatar asked Dec 08 '25 21:12

Wazime


1 Answers

does anyone knows this operator?

In your query the BOTH token assumed to be used as an infix boolean operator. There is no such defined in mysql, hence mysql query parser fails to parse a query.

is it really exists or it's a GroceryCrud bug?

It definitely is a bug caused by generating incorrect SQL query.

like image 77
zerkms Avatar answered Dec 11 '25 09:12

zerkms



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!