Our forum has a photo gallery (Photopost PHP) and on our user profiles, and on the postbit pages, it shows a link to the users gallery IF they have photos in it. There at one point WAS a script in our maintenance scripts that automatically ran to update this count (it was called update_photo_count.php - but it's nowhere to be seen on the drive, and probably hasn't been run since we moved ISP's 4 months ago). We have added a field to our user table in the FORUM DB called "photos"
Let's call the photo gallery DB "Gallery" and the vB DB "Forum"
If I run this query on the GALLERY DB
Quote:
Select userid, user, Count(*) AS num from photos
Group BY userid;
|
I get the output I want (where num is the total of the photos in that users gallery) - my question is - how do I write a PHP script to UPDATE the FORUM DB to the user Table and insert that info into the photos field???
Thanks