0) { //town was found in db $id = mysql_result($result, 0, 'id'); $name = mysql_result($result, 0, 'name'); $lat = mysql_result($result, 0, 'lat'); $lng = mysql_result($result, 0, 'lng'); $zip = mysql_result($result, 0, 'zip'); $result = mysql_query("DELETE FROM Towns WHERE id = '$id' LIMIT 1"); //run the delete query $result = mysql_query("SELECT * FROM Outages WHERE id = '$id'"); //look for town in Outages if(mysql_numrows($result) > 0) { $result = mysql_query("DELETE FROM Outages WHERE id = '$id' LIMIT 1"); //run the delete query } $result = mysql_query("SELECT * FROM DownNow WHERE id = '$id'"); //look for town in DownNow if(mysql_numrows($result) > 0) { $result = mysql_query("DELETE FROM DownNow WHERE id = '$id' LIMIT 1"); //run the delete query } echo("

Town Deleted

\n"); echo("

The town of '" . $name . "' with the following data:
"); echo("Latitude: " . $lat . "
"); echo("Longitude: " . $lng . "
"); echo("Zip Code: " . $zip . "
"); echo("...has been permanantly deleted.
\n"); echo("Return to Power Map.

\n"); } else { //town not found in DB echo("

Error Deleting Town

\n"); echo("

Error: The town '" . $townname . "' was not found in the database.
\n"); echo("Please go back and try again.

\n"); } } else { //confirm box not checked echo("

Error Deleting Town

\n"); echo("

Error: the confirm box was not checked.
\n"); echo("Please go back and try again.

\n"); } mysql_close($db); //close the connection to the db ?>