Re: if then else statement not working
| From: | Gabriel Guzman | Date: | Thu, 05 May 2005 17:59:30 +0000 |
| Subject: | Re: if then else statement not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214564@lists.php.net to get a copy of this message | ||
Anasta wrote:
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) { echo username; } else { echo 'empty'; } ?>mysql_query() returns a resource, not the results themselves. read: http://us3.php.net/manual/en/function.mysql-query.php especially the 2nd example to see what else you need to do to get to your results. hint: mysql_fetch_assoc() have fun, gabe.