Hey, i was hopin you would be able to help me with this *half-request*/*half-cry for help*
I have created a table in mysql with 3 fields, (userid, spam, real)
When the user creates a thread in say forumid==2 the post is counted as a Real post..
when the user creats a thread in say forumid==14 the post is counted as a spam post (its in the spam forum

)
I want to make it so that when the user makes 2 threads in spam forum, that the value of spam increments to two,three, etc...and when they delete a thread, then it decrements..and the same for the "real" value.
I would also like to know how will i distinguish wheter or not the userid is already in the table?
For example i can easily use this statement
PHP Code:
if (($foruminfo['forumid']=='7') || ($foruminfo['forumid']=='11') || ($foruminfo['forumid']=='21'))
{
$DB_site->query("INSERT INTO pubscan (userid,spam,real) VALUES('".$bbuserinfo['userid']."',$countspam,$countreal)");
}
But this will throwback an error if the userid is already there...so the alternative is to use the UPDATE function...but how do i check if a userid is already there??
I can run a SQL statement like
PHP Code:
SELECT * from spamreal WHERE userid=".$bbuserinfo['userid'].";
but how do i check if it comes back empty?