loony383 Posted August 9, 2007 Share Posted August 9, 2007 Hi i want my code to add 1 to postcount of the user when they make a post on my forum but i dont know how to do this, here is my code can someone please tell me how to do the update thing to add 1 to the users postcount $insertpost="INSERT INTO forumtutorial_posts(author,title,post,showtime,realtime,lastposter,forumid) values('$name','$subject','$yourpost','$displaytime','$thedate','$name','$forumid')"; mysql_query($insertpost) or die("Could not insert post"); //insert post mysql_query(*UPDATE users set 'postcound'=$postcount [$postcount=1]) print "Message posted, go back to <A href='index.php?forumid=$forumid'>Forum</a>."; } thats the part of my code where i want it to update the postcount Quote Link to comment Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 maybe mysql_query(UPDATE users set postcound= postcound+1) //sure you dont have a where clause? Quote Link to comment Share on other sites More sharing options...
loony383 Posted August 9, 2007 Author Share Posted August 9, 2007 Parse error: syntax error, unexpected T_STRING in /home2/airserve/public_html/airboard/post.php on line 82 didn't work, i thought it had to have the math stuff like operators in the line but i don't understand about doing stuff within a bit of code like just putting a operator Quote Link to comment Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 that is a syntax error not sql try to put "" around it 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.