Jump to content

[SOLVED] Update problem help needed.


Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/71197-solved-update-problem-help-needed/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.