This is a little part of the code that I have.
[code] $query = "SELECT * FROM some_table
";
$result = mysql_query($query);
$num = mysql_numrows($result);
for($c = 0; $c < $num; $c++) {
$date = mysql_result($result, $c, “date”);
$date = date(“F j, Y | G:i:s”, $date);
/* do some stuff here */
}
[/code]
The first time that ‘$date’ is defined…
$date = mysql_result($result, $c, "date");
…it fetches and returns the date correctly from the database:
2004-04-26 11:06:51
The second time that ‘$date’ is defined is basically to format it to look how ever I want it to look like. I put it in this format…
Month Day, Year | Hour:Minutes:Seconds
using this…
$date = date("F j, Y | G:i:s", $date);
…but instead of displaying the correct date, it displays:
December 31, 1969 | 19:33:24
All right. I tried to break it down so that you could understand what I was saying. I can’t seem to figgure out what’s wrong with it, any help?