I am new to CI.. I want to pass an id from table using anchor tag... but I can't pass maybe my code is not correct.
View . . . . .
<?php
foreach ($records as $value) {
echo "<tr>";
echo "<td align=center >" . $value -> id . "</td>";
echo "<td align=center >" . $value -> name . "</td>";
echo "<td align=center >" . $value -> lastname . "</td>";
echo "<td align=center >" . $value -> classlevel . "</td>";
echo "<td align=center >" . $value -> mobileno . "</td>";
echo "<td align=center >" . $value -> address . "</td>";
echo "<td align=center >" . anchor('StudentController/del_record/'.$value->id ,'Delete') . "</td>";
echo "</tr>";
}
?>
Controller....
public function del_record($value) {
$data = array('id' => $this -> input -> post('$value->id'));
if ($data = $this -> Student_Model -> del_record($data)) {
echo "The operation has been successfully completed";
} else {
echo "query not run";
}
}
`
I am waiting for your response...