Hi All,
Does anyone have any ideas how to change a MySQL timestamp(14) into a useable format using PHP. I tried using the MySQL function date_format(), but I couldn't get it to work.
Here's what I tried:
$selstr = "select date_format(lastupdate, '%W %M %e, %Y %h:%i') FROM stats WHERE id='$id'";
$result = mysql_query("$selstr");
$lastupdate = mysql_fetch_array($result);
echo $lastupdate['lastupdate'];
Now I do these kinds of queries all the time, except this is the first time I have used a MySQL function in the query... and I suspect that is where the problem in.
When I query MySQL directly the query works fine, I just can't get PHP to pull the variable (or should I say, give me the variable).
What am I doing wrong?
Or if you know an easier way to do what I'm trying to do with PHP (without the MySQL function) please let me know.
Thanks