Welcome Guest, Not a member yet? Register   Sign In
Codeigniter getting row details through link (foreach)
#2

[eluser]jvicab[/eluser]
I think that what you need is to pass the id of the row (equipment_id) to the called function. Your controller view_equipment_details will expect one parameter: equipment_id and its header would look like:
function view_equipment_details($equipment_id)
That value will be passed to model function as well:
public function get_equipment_id($equipment_id)
and will be used to build the where clause: $array = array('id' => $equipment_id);
For this to work, you should add this value to the href attribute for the detail link in your view so the controller function will receive it:
echo "<td>".anchor("auth/view_equipment_details/".$item->id, 'Details...', array('class' => 'detail'))."</td>";




Messages In This Thread
Codeigniter getting row details through link (foreach) - by El Forum - 09-06-2014, 01:16 AM
Codeigniter getting row details through link (foreach) - by El Forum - 09-09-2014, 01:35 PM
Codeigniter getting row details through link (foreach) - by El Forum - 09-09-2014, 10:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB