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"); Quote Link to comment 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 Quote Link to comment 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'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.