paxwarrior86 Posted September 16, 2006 Share Posted September 16, 2006 anyone have an idea why this isn't working??1064: 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 'desc = 'Embroidered with children around the world.', country = 'Guatemala' WHE' at line 1Here's my php code:// Update Product$query="UPDATE catalog SET sku = '$productsku', price = '$price', name = '$productname', desc = '$desc', country = '$country' WHERE sku = '$sku'"; Quote Link to comment Share on other sites More sharing options...
shoz Posted September 16, 2006 Share Posted September 16, 2006 http://www.phpfreaks.com/forums/index.php/topic,101366.0.html Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 16, 2006 Share Posted September 16, 2006 In case that's a little cryptic, the core problem is that you should never use [b]reserved words[/b] as field names ... and desc is a reserved word. The desperate workaround is to replace desc with `desc` in your query. The right fix is to rename the field with something that isn't a MySQL reserved word.http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Quote Link to comment Share on other sites More sharing options...
paxwarrior86 Posted September 16, 2006 Author Share Posted September 16, 2006 thank you. that worked. i just changed the column name. i thought from the first reply that i needed add curlies which i had already tried. Quote Link to comment Share on other sites More sharing options...
Shelly302 Posted September 20, 2006 Share Posted September 20, 2006 I'm sorry if this is the wrong place to post this, I'm new here. You error just looked a lot like mine. My problem is I am unable to login to one of my fav websites anymore. The site side it sounded like it was on my side. I just wanted to know what can I do to fix this, but I'm not a programer at all. lol ???Here is the error.MySQL error: 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 'Tomm'' at line 1, occured in query: "select location from member where username = 'S'Tomm'".any help with this would be great. Thanks! Quote Link to comment Share on other sites More sharing options...
craygo Posted September 20, 2006 Share Posted September 20, 2006 your problem is the single quotes. you may have to add slashed in to make the query work.Ray Quote Link to comment Share on other sites More sharing options...
Shelly302 Posted September 21, 2006 Share Posted September 21, 2006 Hello Ray, thanks for getting back to me so soon. :) I have a few more question, the website got back to me and says that their system thinks I’m trying to log on as S Tomm but that’s not me. I am usually automatically logon to the site. They said they made some changes where you have to log in all the time now. Is it possible that something could of happen on their side when they made this change over? Another question, would someone have to manually type that code in, or could a system error cause this to happen? The reason I ask is because I have no knowledge whatsoever of SQL. ??? I never even heard of a SQL until this error, I was wondering how this error could of happen? Could someone gain access and make changes to the SQL, or is there a malicious software that could of done this? I really would like to know because I would hate for something like this to happen again. Since I don’t know who to fix SQL errors I’m now locked out of my own art gallery. :'(Any info on this would be greatly appreciated.Thanks so much. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 21, 2006 Share Posted September 21, 2006 If it's not your site, it's not your problem... Quote Link to comment 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.