Hi, I'm hoping someone might know what I'm doing wrong. I know it's pitiful PHP code that's causing the grief.
I am working on a hack to have two reg pages (individual or group members) and I have entered an extra field into user table called "teamid". I've duplicated register/signup templates and made a register2.php which is the same as normal except new users are registered under a different usergroupid AND I'm trying to incremement "teamid" by 1 each time. This is what I'm trying now, but I've been through a gazillion variations.
Quote:
// - Begin Team ID Tag Count
$users=$DB_site->query_first("SELECT teamid FROM user WHERE userid=$bbuserinfo[userid]);
$tempid1 = 0;
$DB_site->data_seek(0,$users);
while ($users=$DB_site->fetch_array($users)) {
$tempid2 = $user[teamid];
if ($tempid2 > $tempid1){
$tempid1 = $tempid2;
}
}
}
$tempid1 += 1;
$teamid = $tempid1;
// - End Team ID Tag Count
|
What I'm trying to do is retrieve the teamid field from every board member in turn, and when it finds the highest value for teamid it adds 1 then assigns it. I can enter the data back and forth to the DB no prob, just can't get it to incrememnt automatically.

Any ideas?