Re: conditional statement inside while loop?

From: Date: Thu, 01 Sep 2005 19:14:45 +0000
Subject: Re: conditional statement inside while loop?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-221714@lists.php.net to get a copy of this message
At 03:52 PM 9/1/2005, << z a p a n >> wrote:
Hello everyone, I'm using a while loop to display a list of people contained in my database. I'd like to assign different font colors to each depending on which city they're from, but I can't seem to get an if/elseif/else statement to work inside the while loop. Is there another way to do this? Thanks in advance, Zach
That should work, just try a simple if() at first. If it is not working, back up, simplify, just do simple echo to tell you where you are. Better yet, this sounds like an excellent spot to use switch ... case ... break. If you have an editor that can match braces take advantage of that feature. You may not be exactly where you think you are. So, no answer, but hopefully the suggestions are helpful. Cheers - Miles

« previous php.general (#221714) next »