Skip to content Skip to sidebar Skip to footer

Php Delete Mysql Row From Link

I am trying to create a dynamic link that will let the user delete a row from a mysql database based on the rows ID #. I am also trying to input some javascript confirmation that t

Solution 1:

I can give you the basic idea how you can do this. Just create a link for each row which will redirect the control to delete.php(The file which will perform the deletion.) The control will only be redirect in case your user confirm the deletion operation. The link can be like this.

 <a class="button" href="<?php echo base_url();?>delete.php/<?php echo $row->id;?>" onclick="javascript: return confirm('Are you SURE you wish to do this?');">Delete</a>

Post a Comment for "Php Delete Mysql Row From Link"