Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$check="SELECT timestamp FROM med_buy WHERE patient_id='$pid' AND med_id='$mid' ORDER BY timestamp DESC";
我正在使用此代码,我想存储从数据库返回的最高值并且我想检查当前日期的时间戳,请帮助我。
添加一个限制 1 以仅获取第一行然后使用
$data = mysql_query($check); $data = mysql_fetch_assoc($data); $timestamp = $data['timestamp'];
然后检查当天,使用
if(date('Ymd') == date('Ymd', strtotime($timestamp)) { echo "today!"; }
希望这可以帮助