Hi all,
Having a rather annoying problem with this lot of code.
Here is the function i've written that I am trying to use:
function deletewebpagefromdb($webid){
dbconnect();
$q = "DELETE FROM weblist WHERE websiteid = '$webid'";
$result = mysql_query($query) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $q . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
return $result;
}
When i run the query this is what is outputted:
Website ID: 299
A fatal MySQL error occured.
Query: DELETE FROM weblist WHERE websiteid = '299'
Error: (1065) Query was empty
At the top i have echo'd out the websiteid, which is correct, so theres no problems with that.
Can anyone see any problem with this code?