Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  If else statement to choose images

phpMyEdit Features     If else statement to choose images
Post new topic   Reply to topic    
 
Kev     Joined: 02 Jul 2008   Posts: 2  
Post 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  
Post 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    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy