PHP/MySQL Code

From: Date: Fri, 06 Apr 2001 16:51:14 +0000
Subject: PHP/MySQL Code
Groups: php.general 
Request: Send a blank email to php-general+get-47466@lists.php.net to get a copy of this message
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') { <?php include("connect.php"); $result=mysql_query("select * from table where username='$username'",$connection) or die ("Can't do it"); $num = mysql_numrows($result); if ($num = 0) { print "<html>error message etc. exit; } Jeff Oien

« previous php.general (#47466) next »