Currently I am creating a news section for a website.
I have created it so that the news type is separated by a string E.g. category = ,2,4,6,
I don't normally use strings a whole lot, and my initial thought was to do something like this:
$query_listelements = "SELECT * FROM newsitems WHERE released = 1 AND (category = 2 OR category = 4 OR category = 6) ORDER BY date_rel DESC";
Clearly this won't work as I need to isolate / expand the string. so it needs to be something like:
$query_listelements = "SELECT * FROM newsitems WHERE released = 1 AND (category = strval(",2,") OR category = strval(",4,") OR category = strval(",6,")) ORDER BY date_rel DESC";
I don't think the above is the right way to go out things either.
Any thoughts would be really valued!