I have a table in mysql with a row called ‘newrelease’. If the item is a new release my form posts it as ‘yes’ if no ‘no’.
How would i display all items that contain the data ‘yes’?
$query = “SELECT * FROM movielist ORDER BY newrelease DESC LIMIT 4”;
You could filter the data on the PHP side, but that would be a bad idea : it would mean load more data than you need, for nothing…
The best solution is to use a
whereclause in your SQL query, which would then look like this :Up to you to re-integrate this in your PHP code 😉
And, as an example of page that could give you some additionnal informations : Where (SQL) on wikipedia.