Re: [PHP] if then else statement not working

2005-05-09 Thread Deep
Hi, Where are the dollar signs before seatnum, seat1 etc in the if condition. ..Deeps.. --- Anasta <[EMAIL PROTECTED]> wrote: > What am i doing wrong here, the output is always > 'empty' > > > > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_erro

Re: [PHP] if then else statement not working

2005-05-05 Thread Rasmus Lerdorf
Anasta wrote: > What am i doing wrong here, the output is always 'empty' > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_error()); > > if (seatnum == seat1) { > echo username; > } else { > echo 'empty'; > } > ?> That doesn't even look like PHP cod

Re: [PHP] if then else statement not working

2005-05-05 Thread Philip Hallstrom
What am i doing wrong here, the output is always 'empty' if (seatnum == seat1) { echo username; } else { echo 'empty'; } ?> Just guessing since I'm not sure what you're trying to do, but... $result = mysql_query("SELECT username FROM users WHERE seatnum='seat1'") or die(mysql_error());

Re: [PHP] if then else statement not working

2005-05-05 Thread Gabriel Guzman
Anasta wrote: What am i doing wrong here, the output is always 'empty' 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

Re: [PHP] if then else statement not working

2005-05-05 Thread bala chandar
On 5/5/05, Anasta <[EMAIL PROTECTED]> wrote: > What am i doing wrong here, the output is always 'empty' > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_error()); > > if (seatnum == seat1) { you must use if (seatnum == "seat1") { > echo userna