Re: PHP/MySQL Code
| From: | Steve Werby | Date: | Fri, 06 Apr 2001 16:56:12 +0000 |
| Subject: | Re: PHP/MySQL Code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47469@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/