hi im trying to remove articles from a database
what i do is retrive the list turn them into links
and when you click the link that article will be removed from the table
here is the code
$query = mysql_query("SELECT * FROM Articles");
while($queryresult = mysql_fetch_array($query))
{
$articleid = $queryresult["ID"];
$headline = $queryresult["headline"];
$body = $queryresult["body"];
$date = $queryresult["date"];
$staffid = $queryresult["staffid"];
$listofarticles .= "<li><a href=\"index.php?id=" . $articleid . "\">" . $headline . "</a></li>";
}
if($_GET["id"])
{
mysql_query("DELETE FROM Articles WHERE class_id = '" . id ."'");
$statement= 'articlet deleted';
}else{
?>
<h1>Political Science Data Base</h1>
<form>
<input type="button" onClick="window.location='index.php'" value="main menu" />
</form>
<h4>List of Articles</h4>
<?php echo $statement; ?>
<?php echo $listofarticles; ?>
<?php } ?>
im not sure if i am even using the right code