[thelist] sql delete query error help

Sarah Sweeney sarah at designshift.com
Tue Jan 21 14:29:01 CST 2003

>I'm trying to do a simple delete and I keep getting an error. Here it
>SQL-query :
>DELETE prodtemp.prodName FROM prodtemp WHERE pid = 145
>MySQL said:
>You have an error in your SQL syntax near 'prodtemp.prodName FROM
>prodtemp WHERE pid = 145' at line 1
>This makes no sense! prodtemp is most definitely the name of the
>table. pid is indeed a field as is prodName. 145 does exist in the

The correct syntax for a delete in this case would be:
DELETE FROM prodtemp WHERE pid = 145

This is because you are trying to delete an entire record from the
database, not just the prodtemp.prodName field.


More information about the thelist mailing list