Re: error when trying to delete a record

From: Date: Mon, 11 Jul 2005 13:58:07 +0000
Subject: Re: error when trying to delete a record
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-218434@lists.php.net to get a copy of this message
Ross wrote:
I dunno if my text book is out of date or I have made a syntax error but I am trying to delete a record with $query= "DELETE FROM sheet1 WHERE id=$id"; $result= mysql_query($query); if($result){ echo "it was deleted"; } else echo mysql_error(); } and I get the followign sql error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
echo out $id and/or your query to ensure it is what you think it is. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#218434) next »