User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 391,859 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,584 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 1595 | Replies: 2
Reply
Join Date: Jun 2005
Location: USA
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Error with Update

  #1  
Jul 26th, 2005
This sql command is for PHP but this is what happen to it after php had made chenges:

UPDATE Catalog SET Table='Harrow_VH'  WHERE Name='Variable Action Harrow'


I get this error both places php and mysql client it self:

MySQL said:

You have an error in your SQL syntax near 'TABLE = 'Harrow_VH' WHERE Name = 'Variable Action Harrow'' at line 1

Please help as i have no idea what to do and tried everthing i knew...
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Error with Update

  #2  
Jul 27th, 2005
Your question is constructed in way making it difficult to read, but I have 1 thing for you.

"table" is a reserved word in MySQL. You should not name a colulmn "table". You can use reserved words, but in your queries, you'll have to put brackets around the reserved word like this:
[PHP]
$sql = "UPDATE Catalog SET [Table] = 'Harrow_VH' WHERE Name = 'Variable Action Harrow'";
[/PHP]
But do yourself a favor, do not name any objects in your database using any of the reserved words.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
Join Date: Jun 2005
Location: USA
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: Error with Update

  #3  
Jul 27th, 2005
Thanks A lot

Sorry about the wrong way of writing as i was in a hurry.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MySQL Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 6:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC