Author Topic: Need Help with Updating Number of User posts.  (Read 144 times)

0 Members and 1 Guest are viewing this topic.

Offline liquidspacemanTopic starter

  • Irregular
    • View Profile
Need Help with Updating Number of User posts.
« on: February 08, 2010, 10:32:38 PM »
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?

Code: [Select]
$sql = "update tbl_user set post=post+1

where (id='$user_id') and (code='$user_code')";

$result = mysql_query($sql);

}

Offline Hailwood

  • Enthusiast
  • Gender: Male
  • Ask not can, instead ask how!
    • View Profile
    • WebSpirited.com
Re: Need Help with Updating Number of User posts.
« Reply #1 on: February 09, 2010, 12:35:01 AM »
Code: [Select]
$sql   = "update tbl_user set post=post+1
where id='".$user_id."' and code='".$user_code."'";
$result   = mysql_query($sql);
}

try that.


Regards,
Hailwood
« Last Edit: February 09, 2010, 12:37:35 AM by Hailwood »
Occupation: Web Developer
www.webspirited.com & www.thirdscreeninteractive.com
HTML, CSS, JS, PHP

Offline liquidspacemanTopic starter

  • Irregular
    • View Profile
Re: Need Help with Updating Number of User posts.
« Reply #2 on: February 09, 2010, 03:03:38 AM »
Thanks Haliwood. Didn't work unfortunately. Still not updating the post count.

Any other ideas?

Offline jl5501

  • Devotee
  • Gender: Male
  • PHP Freelancer
    • View Profile
Re: Need Help with Updating Number of User posts.
« Reply #3 on: February 09, 2010, 03:08:22 AM »
is the post field in the table defined as an integer?

Offline liquidspacemanTopic starter

  • Irregular
    • View Profile
Re: Need Help with Updating Number of User posts.
« Reply #4 on: February 09, 2010, 05:31:46 AM »
Yes. It is defined as INT(11) :confused:

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.