I am a beginner in PHP and Javascript, so I'm struggling to compare two dates in a SELECT
request like this:
<?php
require 'db.php';
$sql = "SELECT * FROM shortcode WHERE invalid_from_shortcode < Date()";
$result = pg_query($sql);
if (!$result) {
echo "Problem with query " . $query . "<br/>";
echo pg_last_error();
exit();
}
?>
I'm trying to select only the 'shortcodes' where the [invalid_from_shortcode] column is inferior from the current date.
I don't know how to get the current date and whether the structure is correct.