Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Illuminate/database
- $result = DB::table('info_users')
- ->whereRaw('JSON_SEARCH(`roles` ->> ?, "one", ?) IS NOT NULL', [
- '$.example',
- 'read',
- ])
- ->get();
- Ошибка
- 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 '?, "one", ?) IS NOT NULL' at line 1 (SQL: select * from `info_users` where JSON_SEARCH(`roles` ->> $.example, "one", read) IS NOT NULL)
- Рабочий запрос
- select * from `info_users` where JSON_SEARCH(`roles`->>'$.example', "one", 'read') IS NOT NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement