curious of Hither Green writes:

> printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a></td></tr>",
    $PHP_SELF, $myrow["id"]);

Is there a reason why you're not using interpolation?
This looks simpler to me, and I thought that a lot of effort
went into optimising PHP interpolation.

echo "<A HREF='$PHP_SELF?id=$myrow[id]&delete=yes'>Delete $myrow[id]</A>";


cheers,
Jeff

-----Original Message-----
From: Peter Houchin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 4:38 AM
To: YoBro; [EMAIL PROTECTED]
Subject: RE: [PHP] How to delete a row from MySql


db connection here

if ($delete){
$rs = "DELETE FROM users WHERE id=$id";

          $result = mysql_query($rs);

          echo "<font face=\"Helvetica, sans-serif\" size=\"3\"
color=\"#003399\">Record Deleted  <P> ";
}


$id = $myrow["id"];
printf("<a href=\"%s?id=%s&delete=yes\">(DELETE)</a></td></tr>", $PHP_SELF,
$myrow["id"]);

-----Original Message-----
From: YoBro [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 3:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to delete a row from MySql


Hello,

Does anybody know how to make a text link delete items from a MySql
Database.

I have a PHP page that reads from the database and displays the results, but
i want to include an option at then end of each row to delete that
information. Alot like in phpMyAdmin. I have looked at that code, but can't
figure it out.

Any help on this would be really great.

--
Regards,


YoBro
-------------------------------------------------------------
DO NOT REPLY TO THIS VIA EMAIL
PLEASE USE THE NEWSGROUP
All emails sent to this address are automatically deleted.
This is to avoid SPAM!
-------------------------------------------------------------



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to