liquidspaceman Posted February 9, 2010 Share Posted February 9, 2010 Hello Everyone, I am having an issue with updating the number of users posts when they post to my forum. This is the code I am using but the "post" field in the table does not update to show the new number of posts in the forum. Help? $sql = "update tbl_user set post=post+1 where (id='$user_id') and (code='$user_code')"; $result = mysql_query($sql); } Link to comment https://forums.phpfreaks.com/topic/191450-need-help-with-updating-number-of-user-posts/ Share on other sites More sharing options...
Hailwood Posted February 9, 2010 Share Posted February 9, 2010 $sql = "update tbl_user set post=post+1 where id='".$user_id."' and code='".$user_code."'"; $result = mysql_query($sql); } try that. Regards, Hailwood Link to comment https://forums.phpfreaks.com/topic/191450-need-help-with-updating-number-of-user-posts/#findComment-1009264 Share on other sites More sharing options...
liquidspaceman Posted February 9, 2010 Author Share Posted February 9, 2010 Thanks Haliwood. Didn't work unfortunately. Still not updating the post count. Any other ideas? Link to comment https://forums.phpfreaks.com/topic/191450-need-help-with-updating-number-of-user-posts/#findComment-1009294 Share on other sites More sharing options...
jl5501 Posted February 9, 2010 Share Posted February 9, 2010 is the post field in the table defined as an integer? Link to comment https://forums.phpfreaks.com/topic/191450-need-help-with-updating-number-of-user-posts/#findComment-1009297 Share on other sites More sharing options...
liquidspaceman Posted February 9, 2010 Author Share Posted February 9, 2010 Yes. It is defined as INT(11) Link to comment https://forums.phpfreaks.com/topic/191450-need-help-with-updating-number-of-user-posts/#findComment-1009342 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.