Re: if then else statement not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Anasta <neretlis@xxxxxxxxxxxxxx>:
> 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@xxxxxxxxxx         | http://vermontbotanical.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux