Hi,
I have had this script running for ages and then something went wrong and suddenly it won't work... all very strange.
I am checking to see if a value, the postcode, is in the database.
// Set SQL query postcode exists
$query = "SELECT COUNT(*) FROM $table WHERE postcode_outward=\"$postcode_part[0]\" ";
// Run the query
$result = mysql_db_query($database,$query);
// Get number of rows
$numrows = mysql_result($result,0,"count(*)");
// Print the number of rows
echo $numrows."<br>";
This is what the query looks like:
SELECT COUNT(*) FROM postcode WHERE postcode_outward="SG16"
Number of row is:
Yet, I know that the value is in the database. If anyone can help or knows a better way to do this, I will be very pleased.
Thanks,
James