I have a field Publish_on in my mysql database table. It stores the date and time when a post was added.
I am not able to get the publish dates. Instead, the output I get is today's date, even if the post belongs to other dates.
$id = (int) ($_GET['postid']);
$result = mysqli_query("
SELECT Publish_on
FROM `post_head`
WHERE `post_id` = '" . $_GET['id'] . "'
");
$row = mysqli_fetch_row($result);
$date = date_create($row['Publish_on']);
echo date_format($date, 'g:ia \o\n l jS F Y');
$idvariable? You never use it.