Re: PHP/MySQL Code
| From: | Brian S. Dunworth | Date: | Fri, 06 Apr 2001 17:01:37 +0000 |
| Subject: | Re: PHP/MySQL Code | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47471@lists.php.net to get a copy of this message | ||
At 11:51 AM 4/6/01 -0500, Jeff Oien wrote:
if ($num = 0) {
print "<html>error message etc.
exit;
}
This "conditional" will always run. you are assigning $num the value of zero within your if() statement, and that assignation actually happens, so the result is "true" and the braced statements run.
Try:
if ($num == 0) {
print "blah blah blah, etc.\n"
exit;
}
- Brian
-------------------------------------
Brian S. Dunworth
Sr. Software Development Engineer
Oracle Database Administrator
The Printing House, Ltd.
(850) 875-1500 x225
<brian@theprintinghouse.com>
-------------------------------------