View Full Version : Help w/ pulling subscribers out of the database
goblues
11-12-2005, 04:56 AM
This is what I have and I am getting an error stating that userid is abiguous. Please help. By the way running 3.5.1.
// query active subscriptions
$getusers = $db->query_read("
SELECT user.userid,username
FROM " . TABLE_PREFIX . "user
LEFT JOIN " . TABLE_PREFIX . "subscriptionlog as subscriptionlog ON (subscriptionlog.userid = user.userid)
WHERE subscriptionlog.status = '1' ORDER BY regdate DESC LIMIT 10
");
Marco van Herwaarden
11-12-2005, 05:51 AM
Are you sure you're getting the error from the above line? You shouldn't get it here.
PS You should change:
FROM " . TABLE_PREFIX . "user
to:
FROM " . TABLE_PREFIX . "user AS user
goblues
11-12-2005, 07:58 AM
Well that little change you told me to make worked. Whether it was supposed to work, I don't know :cool: but that took care of the problem. Thanks!!!!!
EDIT.....Actually as I looked closer I was using $DB instead of $db. Would that make a difference. Also, what is the difference between $db and $db_site? As you can probably tell, I am just learning. Thanks for your time!
Marco van Herwaarden
11-12-2005, 10:17 AM
Yes $db or $DB makes a difference. $DB_site is the vB3.0 notation, in vB3.5 replaced by $vbulletin->db, or simply $db depending on the scope in the script.
goblues
11-12-2005, 11:43 AM
Yes $db or $DB makes a difference. $DB_site is the vB3.0 notation, in vB3.5 replaced by $vbulletin->db, or simply $db depending on the scope in the script.
10-4 Thanks for the info!!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.