You are here: Re: [PHP] error when trying to delete a record « PHP « IT news, forums, messages
Re: [PHP] error when trying to delete a record

Posted by John Nichel on 07/11/05 16:58

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация