You are here: Re: if then else statement not working « PHP « IT news, forums, messages
Re: if then else statement not working

Posted by Matthew Weier O'Phinney on 05/05/05 20:57

* 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация