super-newbie variable question
Posted: Wed Jan 27, 2010 3:19 pm
I create a variable "$num_rows" and assign it to a record result from a mysql query - why can't I access that variable later? sorry if this is a real silly question
Thanks for any help
Code: Select all
$query="SELECT * FROM testable WHERE `NAME`='AVAILABLE'";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
// works here but not down below
echo "$num_rows Rows\n";
if ($num_rows = 0) {
echo "<br><h2 style=\"color: #ff0000\">This set of is completly filled out</h2><br>";
}
// find out why this doesn't work
echo "$num_rows". " left";