Log in

View Full Version : php switch



kpw
08-13-2008, 03:40 PM
is it possible to create a dynamically generated php switch statement which gets it's contents from a mysql database. i have no problems creating a switch statement on its own, but when i try to create one based on the contents of a database, i get an error message because the switch line is not immediately followed by a case line.

any help would be apreciated.

kpw
08-13-2008, 10:41 PM
ok, i've solved this problem now. had a bit of a brain freeze, but realised i don't need a switch statmement, i can just use the variable directly to access the corresponding row on the database.