i have te make a slection but cannot get it to work with the WHERE LIKE function. What is wrong with the line below?
$result = mysql_query("SELECT * FROM games WHERE soort='nieuws' AND gamenaam='$spelnaam' AND platform LIKE '%wiiu%' AND ORDER BY id DESC");
It worked until i added
AND platform LIKE '%wiiu%'
The platform column contains cells with multiple values that come from a selection box form. So it writes, wiiu, ps4, xbox360, pc etc....Must be simple but i tried like a million times...
Remove the AND
before ORDER BY
$result = mysql_query("SELECT * FROM games WHERE soort='nieuws' AND gamenaam='$spelnaam' AND platform LIKE '%wiiu%' AND ORDER BY id DESC");
should be
$result = mysql_query("SELECT * FROM games WHERE soort='nieuws' AND gamenaam='$spelnaam' AND platform LIKE '%wiiu%' ORDER BY id DESC");
There is an extra AND
, it should be:
$result = mysql_query("SELECT * FROM games WHERE soort='nieuws' AND gamenaam='$spelnaam' AND platform LIKE '%wiiu%' ORDER BY id DESC");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With