Web Hosting - Electric blanket - Find jobs - Health 2007 - Debt Consolidation

PDA

View Full Version : 'Syntax error in INSERT INTO statement' - simple statement - cant find error


angrypenguin
Dec 1st 2006, 2:05 pm
Hi all,

I had the above error message when I have tried to enter information from a form into a database. The code I've got is like this:

<cfinsert datasource="site" formfields="name,email,comments,postid,date" tablename="comments_section">

I know that the datasource can be found becuase I can read the data from that particular table. I'm a bit lost - can anyone help?

Thanks in advance,
Andy

JasonBartholme
Dec 7th 2006, 10:09 pm
Hi Andy,

I don't immediately see an error in your code, but as a rule of thumb I don't use <cfinsert>. I prefer using the SQL syntax for my inserts. You can have better control over the data going into the table.

Hope this helps,
Jason

swirl1980
Dec 8th 2006, 3:24 am
agree with above, leave sql to sql and cf to cf!!!

datropics
Dec 16th 2006, 6:35 pm
yup - definitely agree - I've had issues with cfinsert in the past - just don't use 'em anymore -