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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -