I used your example to project myself over the problem. and now it stands solved here is the The Controller looks like this now
$id=@$_GET["id"];
$amend = Model::factory('amendments')->get_customer_list(@$d);
$this->page_title = 'I&M CRB Online App amending';
$this->content = View::factory('forms/amendments');
//$this->rightwidget =view::factory('rightwidget');
$this->amend = $amend;
$this->next = $id;
the view looks something like this
<?php
if (!$next){
$next = "0";}
$nextid = $next+"1";
$previd=$next-"1";
?>
<a href="<?php echo HTTP_PATH; ?>/amend/getnext/?id=<? echo "0"; ?>">First Record </a> |
<a href="<?php echo HTTP_PATH; ?>/amend/getnext/?id=<? echo $previd;?>">Previous Record</a> |
<a href="<?php echo HTTP_PATH; ?>/amend/getnext/?id=<? echo $nextid;?>">move next</a> |
<a href="<?php echo HTTP_PATH; ?>/amend/last">Last Record</a>
<?php
foreach (@$amend[@$next] as $key=>$value){
echo "<p><span>".$key."</span><input class='contact' type='text' name='".$key."'value='".$value."' /></p>";
}
?>
and for the last record i had to use a different model function
public function get_last_customer(){
$last_customer= DB::select()->from('customers')
->order_by('id','DESC')
->limit(1)
->execute()
->as_array();
return $last_customer;
Thank you all for the support and the answers you provided me with.