I am trying to connect to a data base to pull the information down. The database contains thousands of postcodes that advise the user if it is in a flood risk area.

I have successfully connected to the database but am having trouble pulling the information from the database. If the postcode is not listed it should return - postcode not listed. The code I am using is returning every postcode back saying not listed so I must have an error in my "get details". Any help would be appeciated.

My php code is
$postcode = "postcode1";
$result = mysql_query("SELECT * FROM `TABLE 1` WHERE postcode='$postcode' ")
or die(mysql_error());


$row = mysql_fetch_array( $result );
if(mysql_num_rows($row) >= 1)
{
echo "Postcode: ".$row['postcode'];
echo "Level: ".$row['level'];
echo "Floodlevel: ".$row['floodlevel'];
} // display success message

else { echo "The postcode entered is not listed on the database";
}