If anyone could spot where I'm going wrong here, that would be much appreciated.
I have a field, dateadded, in a table, that just time stamps when a new record is added.
I'm just trying to display that date on pages in the format 27th August 2010.
I have a query that looks like this :
<?php
$currentPage = $_SERVER["PHP_SELF"];
$colname_DateFormat = "1";
if (isset($_Get['packageID'])) {
$colname_DateFormat = (get_magic_quotes_gpc()) ? $_Get['packageID'] : addslashes($_Get['packageID']);
}
mysql_select_db($database_connPackages, $connPackages);
$query_DateFormat = sprintf("SELECT date_format(dateadded, '%%D %%b %%Y') as formatted_date FROM packages WHERE packageID = %s", $colname_DateFormat);
$DateFormat = mysql_query($query_DateFormat, $connPackages) or die(mysql_error());
$row_DateFormat = mysql_fetch_assoc($DateFormat);
$totalRows_DateFormat = mysql_num_rows($DateFormat);
?>
And am using this to echo the date :
<?php echo $row_DateFormat['formatted_date']; ?>
But its just drawing a blank....
Any ideas?