function code=
<?
function convert_time($mysql_timestamp){
if(ereg("([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})",$mysql_timestamp,$res));
$year=$res[1];
$month=$res[2];
$day=$res[3];
$hour=$res[4];
$min=$res[5];
$sec=$res[6];
return(array($year,$month,$day,$hour,$min,$sec));
}
?>
want to display date in the display block. it all works fine, just need the date thing doin!!!
<?
include("../conf.php");
include("functionstwo.php");
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query = "SELECT id, function, date, title, copy, link, image_ref FROM $tablename ORDER BY date DESC";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$row = mysql_fetch_array($result);
while($row = @mysql_fetch_array($result)){
$id = $row['id'];
$function = $row['function'];
$date = convert_time($mysql_timestamp);
$title = $row['title'];
$copy = $row['copy'];
$flycopy = substr($copy, 0, 100);
$link = $row['link'];
$image_ref = $row['image_ref'];
$display_block .= "$title<br>
$flycopy<a href=\"story1.php?tablename=$tablename&id=$id \"target=\"content\">...more</a><br>$date
<br><br>";
}
print "<B>$tablename</B> <a href=\"gelzine_html.php\">back</a><BR>";
echo "$display_block";
?>
manythanks
dan.