RE: [PHP] PHP/MySQL Code

From: Date: Fri, 06 Apr 2001 17:05:37 +0000
Subject: RE: [PHP] PHP/MySQL Code
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47472@lists.php.net to get a copy of this message
> "Jeff Oien" <jeff@webdesigns1.com> wrote: > > This code won't work. I'm trying to get an error if the username > > is entered incorrectly but it won't go through the if brackets. I even > > tried printing out $num and it's 0. I also tried > > if ($num = "0") { > > if ($num = '0') { > > The single "=" sets the variable $num to that value. A double "==" is an > equality comparison operator - that's what you want in this case. Also, > since mysql_numrows() returns a number, not a string, you don't need quots > around the 0. > > -- > Steve Werby > President, Befriend Internet Services LLC > http://www.befriend.com/ Ah, one of those repeated rookie mistakes. Thanks for helping me out. Jeff Oien

« previous php.general (#47472) next »