Rusty.Metal Posted February 11, 2003 Share Posted February 11, 2003 //update sql if ($Edit == "Edit!") { $sql = "UPDATE News SET UserName='$usernameform', UserMail='$usermailform', Subject='$subjectform', MessageText='$messageform', WHERE ID='$newsid'"; if (@mysql_query ($sql)) { echo("News has been Updated."); } else { echo("Error adding submitted news:".mysql_error () ."...");}} $news id is the form befor it.... i get Error adding submitted news:You have an error in your SQL syntax near 'WHERE ID='17'' at line 6... Link to comment Share on other sites More sharing options...
0 Quboid Posted February 11, 2003 Share Posted February 11, 2003 You have a comma after MessageText='$messageform'. As it's the end of that list it should not have a comma. Link to comment Share on other sites More sharing options...
Question
Rusty.Metal
//update sql if ($Edit == "Edit!") { $sql = "UPDATE News SET UserName='$usernameform', UserMail='$usermailform', Subject='$subjectform', MessageText='$messageform', WHERE ID='$newsid'"; if (@mysql_query ($sql)) { echo("News has been Updated."); } else { echo("Error adding submitted news:".mysql_error () ."...");}}$news id is the form befor it....
i get
Error adding submitted news:You have an error in your SQL syntax near 'WHERE ID='17'' at line 6...
Link to comment
Share on other sites
1 answer to this question
Recommended Posts