Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Utorok, 13. október 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  If else statement to choose images

phpMyEdit Features     If else statement to choose images
Odoslať novú tému   Odpovedať na tému    
 
Kev     Založený: 02.07.2008   Príspevky: 2  
Príspevok 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  
Príspevok 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    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov