bkpaul Posted September 29, 2007 Share Posted September 29, 2007 Hi Folks, Newbie here (ok don't all run for cover ) Using MySQL 5.0, CF8, DW CS3 I am trying without much luck to update a few colums of a table and I get the following error, could someone please slap me around the head and tell me what I messed up on because I can't seem to fathom it. Thanks Error Executing Database Query. 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 'Mcclean,HOMEPLAYER1SCORE=45,HOMEPLAYER1BREAK=10, AWAYPLAYER1BREAK=12,AWAYPLAYER1' at line 2 The error occurred in C:\ColdFusion8\wwwroot\casanddistrict2\Results\results.cfm: line 364 362 : UPDATE results 363 : SET HOMEPLAYER1=#form.homeplayer1#,HOMEPLAYER1SCORE=#form.homeplayer1score#,HOMEPLAYER1BREAK=#form.homeplayer1break#, AWAYPLAYER1BREAK=#form.awayplayer1break#,AWAYPLAYER1SCORE=#form.awayplayer1score#,AWAYPLAYER1=#form.awayplayer1# 364 : WHERE results.resultindex = #url.resultindex#; 365 : </cfquery> 366 : <cfelse> -------------------------------------------------------------------------------- SQLSTATE 42000 SQL UPDATE results SET HOMEPLAYER1=M Mcclean,HOMEPLAYER1SCORE=45,HOMEPLAYER1BREAK=10, AWAYPLAYER1BREAK=12,AWAYPLAYER1SCORE=56,AWAYPLAYER1=M Coolican WHERE results.resultindex = 15; VENDORERRORCODE 1064 DATASOURCE cdsl The full code for the query is: <cfquery datasource="cdsl"> UPDATE results SET HOMEPLAYER1=#form.homeplayer1#,HOMEPLAYER1SCORE=#form.homeplayer1score#,HOMEPLAYER1BREAK=#form.homeplayer1break#,AWAYPLAYER1BREAK=#form.awayplayer1break#,AWAYPLAYER1SCORE=#form.awayplayer1score#,AWAYPLAYER1=#form.awayplayer1# WHERE results.resultindex = #url.resultindex# </cfquery> url.resultindex returns a value of 15 as it should in this instance the row of data being updated is 34 colums long but I am just trying to update the 6 given above resultindex is the primary key in the results table. Quote Link to comment https://forums.phpfreaks.com/topic/71197-solved-update-problem-help-needed/ Share on other sites More sharing options...
bkpaul Posted September 30, 2007 Author Share Posted September 30, 2007 Solved because me is thick, next time I will run coldfusion tags on a coldfusion page doh!!! :'( Quote Link to comment https://forums.phpfreaks.com/topic/71197-solved-update-problem-help-needed/#findComment-358137 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.