howdy all,
this should be fairly simple but not turning out to be so am asking for a
little help..
I have a script that fetches all the records in a table and display's them
on the screen.
I get and display the records with the following:
<?
// get the list of resellers from the db
$res = mysql_query("SELECT * FROM resellers ORDER BY id");

// print all records in the DB
while ($myrow = mysql_fetch_array($res)){
echo "<tr><td><div align='center'><font
class=\"content\">".$myrow['id']."</font></div> </td><td>&nbsp;</td><td><div
align='justify'><font
class=\"content\">".$myrow['company']."</font></div></td>";
        printf("<td><font class='content'><a
href=\"%s?op=resellers&id=%s&delete=yes\">(DELETE)</a></font></td></tr>",
$PHP_SELF, $myrow["id"]);
}?>

now when I click on delete it just reloads the page and doesn't delete the
record. I have this code before anything else on the page to handle the
delete...

if($delete){
$res= mysql_query("DELETE FROM resellers WHERE id=$id");
header("Location: admin2.php?op=resellers");
}

I am relying on the $delete and $id to be set by the url link.

any idea's as I'd like to be able to do this with out having to use a form
with hidden vars..

Cheers

Peter
"the only dumb question is the one that wasn't asked"



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to