Kev
Joined: 02 Jul 2008
Posts: 2
Posted: 2008-07-02 00:04
Back to top
Reply with quote
|
Hi everyone,
Sorry for the newbie question, but how do you do if-else statement in phpMyEdit? For instance, I have three conditions, Red, Yellow, Green:
Right now, I have this:
$opts['fdd']['Lights']['sql|L'] =
'if(Lights= "red",
"<img src=\"red.gif\"width=20 height=20 border=0> red",
"<img src=\"green.gif\"width=20 height=20 border=0> green")';
This works, but it only chooses between red and green, not yellow. How can i write the statement so that it's like a switch statement?
Thanks for the help!
|
ajh
Joined: 17 Dec 2003
Posts: 236
Posted: 2008-07-03 10:22
Back to top
Reply with quote
|
http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
Have a look at the CASE function
|
|
Post new topic
Reply to topic
|
|
|