One way to do it would be thusly:

foreach($result as $row){
echo '
<a href="delete.php?id=' . $row[id] . '">' . $row[name] . '</a>

This would set up a url that when the user clicks on $row[name] (such as
"Record Description" it would call delete.php with the argument of $row[id]

Within that delete.php, you remove the selected record, then call the
original page.

$sql="DELETE from table where id=$id";

Then do:
echo '
Header("Location: original_location.php");

You can't have any html previous to the Header command, though.

This will return you to your original page where you can do your select
again, and the deleted row won't show up.

You may need to pass parameters on the Header line to let
original_location.php exactly where you were previously. This would have to
be passed either on the url or as a post/get operation when first calling

Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"

-----Original Message-----
From: Peter Goggin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 8:55 AM
Subject: [PHP-DB] PHP amd MYSQL

I am setting up a web page system which involves html pages, php pages and

I have a number of questions and do not know where to find answers.

If  I display the rows from a database table in a php generated html table
is it possible to mark a row so that it can be deleted or modified by
calling another php page? If so is this documented anywhere?

Is there any good source of information on setting up 'forms'to work like
Oracle forms where database records can be inserted, updated or deleted?


Peter Goggin

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to