basically i'm writing a very abstract select function in PHP that selects stuff from a table passed as a parameter and optionally orders it by a second parameter passed.
if the column doesn't exist though i get an order when i try to ORDER BY...
and i don't want to use multiple queries, i know how it can be done that way but i wanna learn some SQL IF statments so here goes:
how is it done?
ive tried a lot of examples from google and here is the closest that i got but it returns an unspecified error...
also still no room for the ELSE clause... help plz!
thx!
-Alex
if the column doesn't exist though i get an order when i try to ORDER BY...
and i don't want to use multiple queries, i know how it can be done that way but i wanna learn some SQL IF statments so here goes:
how is it done?
ive tried a lot of examples from google and here is the closest that i got but it returns an unspecified error...
also still no room for the ELSE clause... help plz!
thx!
-Alex