I want to show on my page that the database they were looking at was last changed to a specific date and time. For this, I have the following code:
$lastUpdate = $pdo->prepare("SELECT lastUpdate FROM bng WHERE lastUpdate IN
(SELECT max(lastUpdate) FROM bng)");
$lastUpdate->execute();
As I mentioned in the title, I want to repeat the result on my page, I tried:
<?php
echo '<p>Database Last Modified on '.date("l, d F Y - h:i:s A",strtotime($lastUpdate)).'</p>';
?>
but it gives me wrong data and error message
Warning: strtotime () expects parameter 1 to be a string,
Hope this question makes sense. Thanks in advance.
source
share