I am working with a phpbb environment however this issue is not related to that. What I have is a calander which has events stored in it. The date of those events are stored in a table winth mySql called event_day as a varchar.
I wrote some php to pull the data out and also to format the date from that column however if I add ANY formatting of any kind it changes the date to Jan 1970.
Code: Select all
$urlPath = "./forum";
include './forum/config.php';
$table_calendar = $table_prefix. "calendar_events";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect"); mysql_select_db("$dbname") or die("Could not select database");
$sql="SELECT event_id, event_subject, event_start_time, event_end_time, sort_timestamp, event_day FROM $table_calendar c";
$result_d = mysql_query($sql) or die("Woops!");
while ($value_d = mysql_fetch_array($result_d, MYSQL_ASSOC))
{
echo "<li>". $value_d["event_subject"] ."<p>".date('d.M.y', $value_d["event_day"]) ."</p></li>";
}
mysql_free_result($result_d);
mysql_close($link)
Either way I have to work with it so is it possible to sort?
many many thanks in advance for any help