I’ve got a function in PHP:
function doSQL($sql,$line)
{
$resutl = mysql_query($sql) or die("Error on line: " . $line . "<br>SQL Query: " . $sql . "<br>Error: " . mysql_error());
return $result;
}
This is for the sole purpose of minimizing the need to type endless MySQL queries.
I call it like this:
$sql = "SELECT name FROM airfields WHERE id LIKE '" . $_GET['id'] . "'";
$result = doSQL($sql,__LINE__);
But, it throws this error on all the calls:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in xxx\xxx\xxx\get_contacts.php on line xx
What am I missing?
A spelling checker in your editor? “$resutl” is clearly wrong.