PHP Date Converter script not working
Posted: Wed Feb 17, 2010 8:20 pm
I'm trying to write a script that converts a unix timestamp to date time, with php, and displays it along with the title it's corresponding article. Now matter how hard, or how many different combinations, I try I can't get it to work and keep getting prompted with the same Prase Error. Can anyone look at the script and error pasted below and point me in the right direction? Thanks for the help.
Code: Select all
Parse error: syntax error, unexpected T_STRING in /xxxxx/htdocs/RecentNews.php on line 14Code: Select all
<?php
// Standard functions
require('functions.php');
// Connect to the database
database_connect('Admin');
// Set up the query and run it
$sql = "SELECT * FROM `cmsarticles` LIMIT 0, 5 ";
$result = mysql_query($sql) or die(mysql_error());
// Start echo of list
echo'<ul>';
while ($row = mysql_fetch_array($result)) {
$timestamp = $row['date'];
$timestamp = date(F d Y,$timestamp);
echo'<li><h3>' . $timestamp . '</h3><p><a href="../admin/viewarticle.php?id=' . $row['ID'] . '">' . $row['title'] . '</a></p></li>';
}
echo'</ul>';
?>