Reply to Re: mySQL delete query

Your name:

Reply:


Posted by Jerry Stuckle on 09/30/96 11:37

php coder wrote:
> Sorry, this is simple... but i'm going cross-eyed trying to find the
> error:
> This code:
> $delete_query = "DELETE FROM $tablename WHERE index = '$index'";
> if($delete){
> mysql_query($delete_query) or die(mysql_error());
> }
>
> is throwing this error:
> Couldn't run query: You have an error in your SQL syntax near 'index =
> 15' at line 1
>
> And everything I'm referencing says the coding is correct.
> Any ideas? suggestions?
>
> Thanks!
>

In addition to index being a reserved word (needs to be in back tickies,
i.e. `index`), 15 looks to be a numeric value - and therefore should NOT
be in single quotes.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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