Any suggestion on how to pass a parameter to a web querry and have it included in the query? Such as an event id.
such as:
SELECT something FROM calendar where id=xxxx
where I pass to the query the value for xxxx?
Also:
Quote:
Originally Posted by ChrisBaktis
Any help with the webquery to list the top to referers and how many referals they have?
|
I am assuming by, "to list the top to referers" you mean the top two (2) referers?
Try in your admin Maintainence sql query (see note):
SELECT COUNT(2) AS count, user.userid AS userid
FROM XXXuser AS users
INNER JOIN XXXuser AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid
*NOTE: replace XXX with the prefix name that you are using for you dB.
The prefix name I use is "vb_" so the query I would use is:
SELECT COUNT(2) AS count, user.userid AS userid
FROM vb_user AS users
INNER JOIN vb_user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid
If you do not have a prefix then use:
SELECT COUNT(2) AS count, user.userid AS userid
FROM user AS users
INNER JOIN user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid
******************
if that is what you want then the below should work in your web query as the query to get the count and who:
SELECT COUNT(2) AS count, user.userid AS userid
FROM " . TABLE_PREFIX . "user AS users
INNER JOIN " . TABLE_PREFIX . "user AS user ON(users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid