Jag använder mysql och lite problem med att uppdatera ett datum. När en forumpost tas bort i forumet måste jag uppdatera datumet med det senaste inlägget.
Jag har två tabeller: forum_topics, forum_posts.
Så här ser min kod ut för att uppdatera datumet:
SQL = "select date from forum_posts WHERE id_topic = '"& request.querystring("idtopic") &"' ORDER BY id DESC"
rs.Open SQL, Connect, 1, 2
Connect.Execute("UPDATE forum_topics SET lastreply = "&rs("date")&", replies = replies - 1 WHERE id_topic = "& request.querystring("idtopic") &""),,128
rs.Close
Felmeddelandet jag får ser ut så här:
[TCX][MyODBC]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 '20:32:22, replies = replies - 1 WHERE id_topic = 36' at line 1