Jump to content

php delete problem


chuddyuk

Recommended Posts

Before anyone says it, iv tried searchin the forum to see if i can work out why my script isnt working, but had no luck. its a simple one anyway:

im trying to delete records from my db using this code:
[code]
<?
include "connect.php";

$id = $_REQUEST['id'];

$query = "DELETE FROM gallery WHERE id = '$id'";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
echo "Database Updated.";

?>
[/code]
I get the error:
Cannot query the database.
Query was empty
anyone know where im going wrong? :)
Link to comment
https://forums.phpfreaks.com/topic/13465-php-delete-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.