- 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:
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:
Now it works! I tried that once but I guess I most have had something in the wrong place.
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:





