query problem
Posted: Sat Jun 18, 2005 4:22 pm
can someone please tell me whats wrong with this query?
i get the error:
i'm guessing i'm not using the update function right because when I use this query to insert data it works:
thank you
Code: Select all
$sql = "e; UPDATE $user WHERE id = $up_id"e;;
$sql .= "e; (subject, body) VALUES "e;;
$sql .= "e; ('$subject', '$body') "e;;
$result = mysql_query($sql);Code: Select all
Database ERROR: UPDATE price WHERE id = 94 (subject, body) VALUES ('gg', 'g') 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 'WHERE id = 94 (subject, body) VALUES ('gg', 'g')' at line 1Code: Select all
$sql = " INSERT INTO $user ";
$sql .= " (subject, body, date) VALUES ";
$sql .= " ('$subject', '$body', NOW()) ";
$result = mysql_query($sql, $cid);