标题: 求助php搜索mysql数据过滤包含指定内容
时间: 2022-09-04发布,2022-09-04修改
$res="select * from update_record where ( code='.$dh.' or code='.$dh.PRE' ) and edition='.$m_max_bb.'";
『回复列表(19|隐藏机器人聊天)』
$res="select * from update_record where ( code='.$dh.' or code='.$dh.PRE' ) and edition='.$m_max_bb.' and edition NOT LIKE '13\_%' ";
$res="select * from update_record where ( code='.$dh.' or code='.$dh.PRE' ) and edition='.$m_max_bb.' and (instr(edition,'13_')>0 or instr(edition,'12_')>0)";
@511,时间的加法如果在php中比较简单,
加一个月:strtotime("+1 months",strtotime('2022-09-05 18:28:23'))
加5天:strtotime("+5 days",strtotime('2022-09-05 18:28:23'))
加5年:strtotime("+5 year",strtotime('2022-09-05 18:28:23'))
你甚至可以:strtotime("+1 week 2 days 4 hours 2 seconds",strtotime('2022-09-05 18:28:23'))
得到结果后用:date('Y-m-d H:i:s',datetime)重新转为日期时间
比如:date('Y-m-d H:i:s',strtotime("+5 year",strtotime('2022-09-05 18:28:23')))
data.timezone=PRC
,还有在php开头用
data_default_timezone_set('PRC');
,结果都一样,还是慢了8个小时,唯一解决办法就是在获取出来的时间戳+28800才可以准确😂你知道啥原因吗