//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","user","password");
//select which database you want to edit
mysql_select_db("spoono_sections");
//If cmd is not hit
if(!isset($cmd))
{
//display all the news
$result = mysql_query("select * from news");
//run the while loop that grabs all the news scripts
while($r=mysql_fetch_array($result))
{
//grab the title and the ID of the enws
$title=$r["title"];//take out the title
$id=$r["id"];//take out the id
echo "$title - Delete";
echo "
";
}
}
?>
if($cmd=="delete")
{
$sql = "DELETE FROM news WHERE id=$id";
$result = mysql_query($sql);
echo "Row deleted!";
}
?>