Location: PHPKode > projects > Sloppy Blog > sloppy-blog/headlines.php
<?
include("dbconnect.php");

//print the news titles, with links to the edit page
$getnews = mysql_query("select * from news ORDER BY id DESC");
while($r=mysql_fetch_array($getnews)){
extract($r);
echo("> <a href=headlines.php?id=$id&action=printit>$title</a><br />");
}
echo("<br /><br />");

//if we are editing a news item, print the following..
if($_GET['action']=="printit"){
$id = $_GET['id'];
$getnews = mysql_query("select * from news WHERE id=$id");
while($r=mysql_fetch_array($getnews)){
extract($r);
echo("<i>$date CST</i><BR><b><u>$title</u></b><BR>$news<HR>");
}
echo("<br /><br />");
?>
Return current item: Sloppy Blog