Requesting Custom Fields from MySQL -
i think there better name trying do.
i have this.
select * user_bans user_id='{$user->id}'
what want this.
select *, active = (date(expire) > now() ? 1 : 0) user_bans user_id='{$user->id}'
the expire field datetime field. want see if ban has expired , set active value accordingly.
what syntax need use this?
this might need!
select *, if(date(expire) > curdate() , 1 , 0) `active` user_bans user_id={$user->id}
Comments
Post a Comment