Quick PHP question!

Soldato
Joined
10 Apr 2006
Posts
7,890
Location
North West
PHP:
$query = "SELECT * FROM table WHERE cUsername = '$cUsername' AND cPassword = '$cPassword'";
	$result = mysql_query($query) 
		or die("Unable to verify user because : " . mysql_error());
		$num_rows = mysql_num_rows($result);
		echo "Rows - " . $num_rows . "<br/>";
		echo "cUsername - " . $cUsername . "<br/>";
		echo "cPassword - " . $cPassword . "<br/>";
When no username or password is input, or wrong information , this is output :

Rows - 1
cUsername -
cPassword -


WHy is it outputting a row when there should be no rows?
 
Back
Top Bottom