Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

SQL syntax Error on UPDATE query

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

TwiztedFake

Established Member
Impact
1
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:
$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);

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:
$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.
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
heh... i always post problems and then figure them out straight away! lol
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back