It was pretty much cut and paisted from the tutorial, but when it posts the news, ithe date comes out as December 31 1969 19:00.
Code: Select all
<?
//Included the header above.
$db=mysql_connect("localhost","user","pass") or die ("cant connect");
mysql_select_db("news",$db) or die ("cant change");
$news=mysql_query("select * from news ORDER BY date DESC LIMIT 5") or die ("cant get em");
while($rows=mysql_fetch_array($news)){
$date=date("F d, Y H:i ",$rowsї"date"]);
$author=$rowsї"author"];
$title=$rowsї"title"];
$email=$rowsї"email"];
$content=$rowsї"content"];
$number="100%";
printf("<table cellpadding=2 cellspacing=0 border=0 width=%s>",$number);
echo "<td bgcolor=#333333 class='first'><b>$title</b></td>";
echo "<td align=right bgcolor=#333333 class='first'>$date</td><tr>";
echo "<td colspan=2><i>by <A href="mailto:$email">$author</a></i><br>
$content</td></table><p>";
}
?>