The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I need some kind of a loop
Hello there,
I would like to know 2 different kind of things. 1) User should be compared to userstats, all userid's that are missing in user, should be deleted in userstats as well. 2) userstats should be updated every month with all important (not all) data from user. user and userstats both have userid for comparison. Also important to know, can't do a regular loop, since it will try every possible userid, wich is madness, since alot of userid's are already missing (deleted). Anyone who could help me with the above 2 questions? |
#2
|
|||
|
|||
What userstats are you talking aobut?
|
#3
|
|||
|
|||
Modpoints and posts basically. (also usergroupid, membergroupids, stuff like that)
I've stored modpoints and posts together with the userid in a seperate table every month. Now I would like to update those tables to delete all deleted userid's from them. BTW, to be a bit more specific, userstats is not a default table, but it holds the data stated above. |
#4
|
|||
|
|||
Can you give the layout of that table please.
|
#5
|
|||
|
|||
user: the normal user table (username, userid, posts, modpoints, usergroupid, membergroupids)
userstats: (userid, posts, modpoints, usergroupid, membergroupids) Example: Userid 4545 is present in userstats, but has been deleted from user. I'd like a query that would update userstats, so it would delete userid 4545 from userstats. |
#6
|
|||
|
|||
[sql]DELETE FROM userstats where userid not in (select userid from user);[/sql]
something like that. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|