i doing mysql query , trying birthdays match current day , month.
here trying realized wont work properly:
$birthdays = $wpdb->get_results(" select * {$wpdb->usermeta} meta_key
= 'birthday' , meta_value
>= unix_timestamp(date(now()))");
this pull birthday of course if birthday in year (not need). birthday stored in db 1304035200
any appreciated. have read many of related posts not need.
the easiest way might convert unix timestamp date , compare it's month , day values month , day values of today. i'm on iphone forgive formatting/typos think following should work (waiting wife while shops :))
select * {$wpdb->usermeta} meta_key
= 'birthday' , ((month(from_unixtime(meta_value
)) = month(date(now()))) , (day(from_unixtime(meta_value
)) = day(date(now()))))
Comments
Post a Comment