Jump to content

Database Queries


robcrozier

Recommended Posts

hi can anyone help me?

what im trying to do is output some data from a mysql table into a table on the bowser. However the tricky part is that i want each row that is outputted to have a link beside it which when clicked will delete that row from the table.

Ive got the basic table outputting at the min and just need to add the delete link.

Oh and the table is being outputted in a loop.

Help would be massively appreciate!!!!!
Link to comment
https://forums.phpfreaks.com/topic/4765-database-queries/
Share on other sites

if each item in your table has an id number... something similar to that below would work.

[code]
<a href="delete_entry.php?id=<?=$id?>">Delete This Entry</a>
[/code]

[code]
<?php
$id = $_GET['id'];
$query = mysql_query(DELETE * FROM your_table WHERE id_field = $id);
?>
[/code]

Might not be exactly right, but it will nudge you along the right path.
Link to comment
https://forums.phpfreaks.com/topic/4765-database-queries/#findComment-16726
Share on other sites

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.