$querystring = "SELECT COUNT (userid) AS count FROM inviter WHERE userid = '$userid'";
$query = mysql_query($querystring);
while($queryobject = mysql_fetch_object($query)){ //line 16
if($queryobject->count = 3){
print "You can't invite any more friends you loser.";
} else {
$invitesleft = 3-$queryobject->count;
print "You can invite ".$invitesleft." more people.";
};
};
What this code is susposta do is check a table in the database called inviter, it will look to see if under the userid (not the primary key in the table) the same userid shows up 3 times or more, thus not allowing anyone to login and submit an invite for more then 3 users.
A bit more clarification, a user can login 3 times and invite 3 people, every time they invite someone there is an entry put in that table that is simular to newmember, newmemberemail, userid, email. The newmember is the person being invited (added later) the newmemberemail is the email of the person being invited (also added later) and the last 2 are the userid and email of the person inviting.
The script causes this error: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\Program Files\Abyss Web Server\htdocs\phpinvite\login_success.php on line 16
I put a comment on line 16 so you guys would know what one like 16 is.
hope this isin't too confusing.