vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Help with user table field incrementing in register.php (https://vborg.vbsupport.ru/showthread.php?t=46334)

KingsGambit 12-03-2002 10:32 AM

Help with user table field incrementing in register.php
 
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?


All times are GMT. The time now is 03:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01029 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete