I am using MySql 5.7.14 and laravel 5.2.
My Table 'user' JSON look like this:
[{ "id": "1", "options": "{\"religion\": \"R'hllor, the Lord of Light\", \"favorite_color\": \"red\"}" }]
when i query through the laravel as:
$ii =\DB::table('user')->where('options->favorite_color', 'red')->get();
i am facing error as
SQLSTATE[HY000]: General error: 2036 (SQL: select * from `user` where `options`->"$.favorite_color" = red)
and when i run the same query as
SELECT * FROM `user` WHERE options->"$.favorite_color"='red'
in phpmyadmin its not giving any error it working fine. Can anyone tell me what may be the issue? Thanks in advance.