PDA

View Full Version : SQL query problem


zitwep
07-14-06, 04:16 AM
Does somebody see whats wrong with it?


$query = "UPDATE " . $tblpref . "emailtemplates SET subject = '" . $tempsub . "', message = '" . $tempmsg . "', signature = '" . $tempsig . "', from = '" . $tempfrom . "' WHERE id = '" . $tempid . "';";




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 'from = 'company@nomail.de' WHERE id = '3'' at line 1


Probalby I'm just beeing dumb again, but I cant see it :confused:

Thanks in advance
Greetz
zitwep

Nico
07-14-06, 04:32 AM
I guess "from" is a registered keyword as used in "SELECT * FROM" etc.. try renaming the field to something else.

zitwep
07-14-06, 04:41 AM
yep that was it,...thanks alot :D

Nico
07-14-06, 04:47 AM
No problem.

Oh, and I'm going to move this to database. :)