Jump to content

Archived

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

ashrafzia

Simple Question about Delete Query

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
[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 ?

Share this post


Link to post
Share on other sites

×

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.