MYSQL时间差函数timestampdiff

三分钟之内是否有请求的短信验证码

select *
from `smscode`
where smscode_mobile='$mobile'
	and timestampdiff(minute,smscode_addtime,now())<=3

你可能感兴趣的:(MYSQL)