Kev
Založený: 02.07.2008
Príspevky: 2
Zaslal: 2008-07-02 00:04
Návrat hore
Odpovedať s citátom
|
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
Založený: 17.12.2003
Príspevky: 236
Zaslal: 2008-07-03 10:22
Návrat hore
Odpovedať s citátom
|
http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html
Have a look at the CASE function
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|