$sql="select *from ls_user
where mid=$mid and group_id<5
and UNIX_TIMESTAMP(date_format(birthday, '".date('Y-',time())."%m-%d'))-UNIX_TIMESTAMP(date_format(now(), '%Y-%m-%d'))<=86400*7
and UNIX_TIMESTAMP(date_format(birthday, '".date('Y-',time())."%m-%d'))-UNIX_TIMESTAMP(date_format(now(), '%Y-%m-%d'))>0;";
date_format() 函数返回根据指定格式进行格式化的日期。
UNIX_TIMESTAMP() 转换时间戳,
注意其中 birthday 字段为date格式