Welcome Guest, Not a member yet? Register   Sign In
i am a codeigniter biginner, i have two files in my view folder. logged _in_ area.php and personal_emp .php. design is
#3

[eluser]cartalot[/eluser]
row array in the model might be an issue, but the bigger problem is -- you have an error, but you dont know where the error is from
solution -- error check each step

in your model, after the $query, make sure there is something there before returning,
otherwise return false. note this is also using query-row()
Code:
if ( $query->num_rows() == 1 ) { return $query->row(); }
else { return FALSE; }

in your controller - i'm showing an echo for debugging, never echo directly from controller for live site
Code:
// IF we did NOT ( the ! ) get something back from model then....
if (! $data['rows'] = $this->emp_model->info1($id) )  
{ echo 'there was an error using id number'. $id ;
// or show the form again or whatever needs to happen here
}
// Else Load the view, now knowing that something has been returned from database
else
{   $this->load->view('personal_emp',$data) ; }





Messages In This Thread
i am a codeigniter biginner, i have two files in my view folder. logged _in_ area.php and personal_emp .php. design is - by El Forum - 07-03-2012, 10:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB