I've looked at the php manual about the date function(date.function ) And I've talked to a friend and I seem to be getting mixed ideas about how to disply timestamp from my mysql database.
One person told me that I needed to use the date function to do this. Such as:
echo $today = date("F j, Y, g:i a");
But I can't get it to use timestamps such as "1036034161"
When reading the notes on the page it suggested that I needed to use something like this:
SELECT date_format(lastaccesstime, '%M %e, %Y') FROM user WHERE userid = 'hecky';
I'm not excactly sure what I need to do here since I'm new to php. But first I would need to connect to the database. Then use the code.
Like:
<?
$db = mysql_connect("localhost", "*", "*");
mysql_select_db("database", $db);
SELECT date_format(lastaccesstime, '%M %e, %Y') FROM ib_topics WHERE tid = '1';
?>
Of course this doesnt work.
What do I need to do to echo a timestamp from the mysql database to come out in date format?