Coconut47 Posted May 9, 2011 Share Posted May 9, 2011 Hello, I have some trouble to display result from my enum tab I did this : if ($level == "a"){ $level = "Level 1"; }else if ($level =="b"){ $level = "Level 2"; }else { $level = "Level 3"; } and on my html <?php echo $level; ?> it display Level 3 on all record... Any idea what I'm doing wrong? Link to comment https://forums.phpfreaks.com/topic/235947-display-enum-filed/ Share on other sites More sharing options...
mrant Posted May 9, 2011 Share Posted May 9, 2011 No idea at all as the code looks spot on. If $level is set to "a" then $level will be "Level 1", set to "b" it will be "Level 2" and anything else will be set to "Level 3". This would suggest that $level is not set to a or b? Not much help, but at leat you know this code is good Link to comment https://forums.phpfreaks.com/topic/235947-display-enum-filed/#findComment-1213022 Share on other sites More sharing options...
Coconut47 Posted May 9, 2011 Author Share Posted May 9, 2011 I really have 'a','b','c' in my database. I don't understand at all... Link to comment https://forums.phpfreaks.com/topic/235947-display-enum-filed/#findComment-1213061 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.