Hey anyone can help?
i just tried to insert a mail into my postgres db with one field for the beginning:
thanks!!
i just tried to insert a mail into my postgres db with one field for the beginning:
INSERT INTO mailContent (from) VALUES ('<%From%>')but the result is an error:
Error. ERROR [42601] FEHLER: Syntax error near »from«;can anyone help?
Error while executing the query.
thanks!!
Hello,
The FROM word is a reserverd keyword for SQL. You have to use other name for your column. For example:
The FROM word is a reserverd keyword for SQL. You have to use other name for your column. For example:
INSERT INTO mailContent (email_from_field) VALUES ('<%From%>')
cheers! that's it!
now i get an error when i add the body fields to the script:
thanks!
now i get an error when i add the body fields to the script:
Code: Select all
INSERT INTO public.mailcontent (id, mail_from, mail_to, mail_cc, mail_bcc, mail_subject, mail_body, mail_bodyhtml)
VALUES ((SELECT MAX(id)+1 FROM public.mailcontent),'<%From%>','<%To%>','<%CC%>','<%BCC%>','<%Subject%>','<%Body%>','<%Body_HTML%>')
Code: Select all
is there any way to get this done?Error. ERROR [42601] ERROR: Syntaxerror near »+«;
Error while executing the query.
thanks!
What database are you using? MySQL, SQL server?
I think that sentence should work fine. It seems to be constructed correctly. Have you tried running it directly in phpMyAdmin or SQL server management studio? Do you get any error?
I think that sentence should work fine. It seems to be constructed correctly. Have you tried running it directly in phpMyAdmin or SQL server management studio? Do you get any error?
Database is postgresSQL.
that code works fine on the db
that code works fine on the db
Code: Select all
when i delete the both body fields, the query does all it should in the parser.INSERT INTO mailcontent(id, mail_from, mail_to, mail_cc, mail_bcc, mail_subject, mail_body, mail_bodyhtml, intrexx_import)
VALUES ((SELECT MAX(id)+1 FROM public.mailcontent), 'my.adress@gmail.com', 'info@myadress.com', '', '', 'Testimport', 'Thanks', '<div dir="ltr">Thanks</div>', false);
Any idea?
Problem fixed in using mssql now.
Great. Thanks for keeping us updated.
- All times are UTC -
