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.
ユーザーが投稿に投票できるアプリケーションを持っていますが、24 時間に 1 回しか投票できないように制限したいと考えています。
データベースから行を選択して、タイムスタンプ フィールドが 24 時間より古いかどうかを確認するにはどうすればよいですか?
mysqlの日付/時刻関数を探していると思います。ここにあなたが拡張するための例として:
… WHERE timestamp_column < NOW() - INTERVAL 24 HOUR;