I've been giving myself a basic refresher course in PHP without using template engines (although I've learnt some Smarty and Twig recently I felt I should keep practising basic PHP), and this is my basic page displaying a list of vehicles and when they were registered:
<?php
// Connects to your Database
mysql_connect("localhost", "testing", "testingpass") or die(mysql_error());
mysql_select_db("cars1") or die(mysql_error());
$data = mysql_query("SELECT * FROM autos")
or die(mysql_error());
echo "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
"<tr>";
//echo "<td>"date("d M Y",strtotime($info['registered']));"</td> ";
echo "<td><tr>".$info['make'] ." ".$info['model'] ."</td><tr> ";
}
echo "</table>";
?>
It works if the datetime is commented out, but if it's uncommented the page appears blank - I'm using MAMP as my webserver, latest PHP.
For a simple page this works well, but how should I format this date? (I used the tutorial at http://erikastokes.com/mysql-help/display-mysql-dates-in-other-formats.php to try this).
What changes should I make to fix this problem with the date and time, as otherwise it works well as a basic MySQL php query.