• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting table records

#2
[eluser]LuckyFella73[/eluser]
hi ozy123,

your table rows are generated via a loop I guess.
Whithin that loop you have 2 possibilities. The first
one is build the delete anchors like
Code:
<a href="&lt;?php echo base_url();?&gt;controller/delete/&lt;?php echo $row-&gt;id;?&gt;">delete</a>
The id would be the related id from your database row. In your controller method you
would make a delete function (or better in your model) using that id you
get from the URI segment.

The second way is to build a form in every singel row, storing the row->id
in a hidden input field. All forms would point to the same controller/method
where you read the id value via input->post('id') and delete the row that way.

Best regards


Messages In This Thread
Deleting table records - by El Forum - 06-24-2012, 04:18 AM
Deleting table records - by El Forum - 06-24-2012, 11:18 AM
Deleting table records - by El Forum - 06-25-2012, 03:30 AM
Deleting table records - by El Forum - 06-25-2012, 03:56 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.