The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
MySQL select
I'm using the vbulletin db classes.
I want to select field19 from users where users is member of group 15 and last activity was within 30 days. Anybody know how to do this? --------------- Added [DATE]1224909756[/DATE] at [TIME]1224909756[/TIME] --------------- Got this far: SELECT user.userid, userfield.field19 FROM user INNER JOIN userfield ON user.userid = userfield.userid WHERE ( user.membergroupids LIKE 15 OR user.usergroupid LIKE 15 ) AND userfield.field19 != ''; Just have to work out how to do the dates. |
#2
|
||||
|
||||
Quote:
select u.userid, uf.field19 from user u join userfield uf using (userid) where find_in_set('15',u.membergroupids) > 0 and to_days(now()) - to_days(from_unixtime(u.lastactivity)) <= 30 [/sql] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|