Hey all,
So I have this very small script that is simply pulling information from a dbase and displaying it. The problem is the date in the dbase is stored in a string (it looks like 1424375795 or something). I need to convert that number to the date and time. Here’s the code:
<?php
//query the database
$query = mysql_query("SELECT * FROM topics ORDER BY last_post");
//fetch the results / convert results into an array
WHILE($rows = mysql_fetch_array($query)):
$topic_id = $rows['last_post'];
$topic_title = $rows['title'];
$reply_author = $rows['last_poster_name'];
$reply_time = $rows['last_post'];
endwhile;
echo "The last post was made in <font color='blue'>$topic_title</font> by <font color='red'>$reply_author</font> at <font color='green'>$reply_time</font>.";
?>