I am trying to return the referrals for users from 'this month' but not sure where to start with joindate
Code:
SELECT count(userid) FROM user WHERE referrerid= '661' AND joindate = 'thismonth'
anyone know how I can do the this month part.
I am going to put this info into usercp so they can see where there upto with referrals for this month and run a competition for most referrals.
Thanks
--------------- Added [DATE]1199892735[/DATE] at [TIME]1199892735[/TIME] ---------------
used this and it seems to work great...
Code:
SELECT username FROM " . TABLE_PREFIX . "user WHERE referrerid='$usersid' AND MONTH(FROM_UNIXTIME(`joindate`))=MONTH(now())