I am trying to create a logic where I SELECT
from my database only rows that have not expired yet. So anything that is greater than NOW()
will now show up.
Here is a modified version of a code:
include_once('Database.php');
try {
$stmt = $conn->prepare("SELECT col1, col2, col3,
format_time FROM table WHERE format_time > NOW()");
$stmt->execute();
} catch (PDOException $e) {
echo $e->getMessage();
My format_time
data is saved as TIMESTAMP
in format of 2018-05-13 23:30:00
(YYYY-MM-DD HH:MM:SS).
For some reason I am still retrieveing my data even after the expire date.