Im trying to get a matching record within a json. Its only ever once within the json with that specific key and it looks like this.
{"bannerpage":["569"],"menulinkage":"569","clickurl":false,}
Im trying to find the matching value of 569 with key as bannerpage. However there's no luck. Just wont play nice.
Here is what i have:
$sql->select("* FROM #__banners WHERE state=1 AND params LIKE '%"bannerpage":["$menu"]%'");
Using the following snippet works but it checks both bannerpage and menulinkage - i only want the value of bannerpage.:
AND params LIKE '%{$menu}%'
I really hope that make sense.
To break it down even simpler:
How do i write a mysql query where i check for a matching number against this json value:
"bannerpage":["569"]
Thanks to anyone for your help Jonny