Re: if then else statement not working

From: Date: Thu, 05 May 2005 17:57:14 +0000
Subject: Re: if then else statement not working
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214563@lists.php.net to get a copy of this message
* Anasta <neretlis@westnet.com.au>: > What am i doing wrong here, the output is always 'empty' > > <?php > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_error()); > > if (seatnum == seat1) { What are you comparing? is seatnum a constant? is seat1 a constant? or is one of these a variable? is one a string? I'm suspecting that what you're trying to compare is more like this: if ($seatnum == 'seat1') { but I don't know for sure if you've defined a $seatnum variable previously. -- Matthew Weier O'Phinney | WEBSITES: Webmaster and IT Specialist | http://www.garden.org National Gardening Association | http://www.kidsgardening.com 802-863-5251 x156 | http://nationalgardenmonth.org mailto:matthew@garden.org | http://vermontbotanical.org

« previous php.general (#214563) next »