The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
What I'm trying to do is create a PHP script (that I'll run at regular intervals via vB cron) that will query a Reviewpost database and count how many reviews a user has made and then post the result for each user in a field in the user database.
I'm new to PHP so your help would be most appreciated. What I've managed to come up with so far is the mySQL query: Code:
SELECT COUNT(rp_reviews.userid) AS FIELD_1, rp_reviews.userid FROM rp_reviews GROUP BY rp_reviews.userid Reviewpost databse name: reviews Forum database name: forums Forum database field: reviewsposted |
#2
|
|||
|
|||
![]()
This should work.
Code:
UPDATE userstable AS u SET u.reviewsposted = (SELECT COUNT(*) FROM rp_reviews AS r WHERE r.userid = u.userid GROUP BY r.userid) |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|