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!"; }
お役に立てれば