loony383 Posted May 9, 2008 Share Posted May 9, 2008 hey, can anyone help me i cant get this update query to work. $updateforum="update ab_forum set numposts=numposts+'1',name=name, forumid=forumid, description=description WHERE forumid='$forumid'"; mysql_query($updateforum) or die("Could not update forum"); Link to comment https://forums.phpfreaks.com/topic/104889-update-query-not-working/ Share on other sites More sharing options...
BaneStar007 Posted May 10, 2008 Share Posted May 10, 2008 I don't know whats right, but I always make sure my variables are static before I put them into the query, Also, numposts+'1' is this a varchar? it should be .'1' if its a number(int) then `(numposts+1)` <-- not static Link to comment https://forums.phpfreaks.com/topic/104889-update-query-not-working/#findComment-537478 Share on other sites More sharing options...
nloding Posted May 12, 2008 Share Posted May 12, 2008 Off what BaneStar said, I think you're going for this: UPDATE ab_forum SET numposts='($numposts+1)',name='$name',forumid='$forumid',description='$description' WHERE forumid='$forumid'; Link to comment https://forums.phpfreaks.com/topic/104889-update-query-not-working/#findComment-538760 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.