Jump to content

Simple Question about Delete Query


ashrafzia

Recommended Posts

I do know how to exectue the delete query but i just wanna clear my concept.
I have a table of Users, having user id's.
I have a button view all records which is used for displaying records from DB.
Now i want that each record should have an image named Delete infront of it and when i mouseover on that image the userid should automatically came on it and by clicking that image the delete query should execute.
And same to Edit Record
Link to comment
https://forums.phpfreaks.com/topic/22010-simple-question-about-delete-query/
Share on other sites

Something like this should do it: [code]<?php
//...
while($u = mysql_fetch_assoc($result))
{
echo <<<EOF
<p>{$u['username']} <button type="button" onclick="this.href='http://example.com/admin/index.php?act=members&func=delete&id={$u['id']}'">Delete</button></p>

EOF;
}
//...
?>
[/code]
[quote author=Daniel0 link=topic=109446.msg441118#msg441118 date=1159205619]
[code]<?php
//...
while($u = mysql_fetch_assoc($result))
{
echo <<<EOF
<p>{$u['username']} <button type="button" onclick="this.href='http://example.com/admin/index.php?act=members&func=delete&id={$u['id']}'">Delete</button></p>

EOF;
}
//...
?>
[/code]
[/quote]

Would you kindly give some explanation ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.