hi. just a quick question about a delete link i have on a page ive made.
basically with the code i have currently...nothing at all happens when i click delete...and i cant for the life of me see the problem.
here is the code for the page where the delete link is.
$sql=mysql_query("SELECT items.itemname, cat.catid, cat.category FROM items,cat WHERE cat.catid=items.catid");
$temp_item = "";
while($res=mysql_fetch_array($sql))
{
echo "<table cellpadding='0' cellspacing='0' width='700'><tr>";
if($res['category'] != $temp_cat )
{
echo "<td width='30%'>" . "<b>" . $res['category'] . "</b>" . "</td>" . "<td width='30%'><a href='delcat.php?id=$res[catid]'>Delete Category</a></td></tr>";
$temp_cat=$res['category'];
}
and here is the code for the delete page that should do the deleting.
include_once("config_class.php");
$db = new db(); // open up the database object
$db->connect(); // connect to the database
//getting id of the data from url
$id = $_GET['id'];
//deleting the row from table
$result=mysql_query("DELETE FROM cat WHERE listid=$id");
//redirecting to the display page (index.php in our case)
header("Location:list.php?id=$id");
as i said nothing happens...please help anybody?