NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page SQL syntax Error on UPDATE query

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-20-2006, 07:50 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
TwiztedFake's Avatar
Join Date: Apr 2004
Location: IL
Posts: 348
TwiztedFake is on a distinguished road
 



SQL syntax Error on UPDATE query


The error is:
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 '(date, time, uname, subject, content) VALUES ('10-20-2006', '6:

My code is:
PHP Code:
$sql "UPDATE ct_news SET (date, time, uname, subject, content) VALUES ('$date', '$time', '$uname', '$subject', '$content') WHERE ID='$id' LIMIT 1";
$result mysql_query($sql); 
????: NamePros.com http://www.namepros.com/programming/249124-sql-syntax-error-on-update-query.html
How did I write this so that it updates the table row with the new data.

**UPDATE**
Geez. . . 2nd problem I've posted this week that I got figured out within 10 minutes of posting it.

Changed the $sql= line to:
PHP Code:
$sql "UPDATE ct_news SET date = '$date', time = '$time', uname = '$uname', subject = '$subject', content = '$content' WHERE ID = '$id' LIMIT 1"
Now it works! I tried that once but I guess I most have had something in the wrong place.
__________________
-TwiztedFake-
RTard Tutorials
Digital-Dummy to Total-Techie
Last edited by TwiztedFake; 10-20-2006 at 08:04 AM.
TwiztedFake is offline  
Old 10-24-2006, 04:22 PM   #2 (permalink)
Soon to be RICHdoggie!
 
PoorDoggie's Avatar
Join Date: Jan 2005
Location: UK
Posts: 2,408
PoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nicePoorDoggie is just really nice
 



heh... i always post problems and then figure them out straight away! lol
PoorDoggie is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:08 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger