I m beginner in codeignitor.my problem is when i fetch data from database all other data has fetched but image are not displayed.please proveide me code for how to fetch image from database.
model file code
class Car_model extends CI_Model
{
function getAllRecords()
{
$this->load->database();
$q = $this->db->get('cardetails');
if($q->num_rows() > 0)
{
return $q->result();
}
return array();
}
}
?>
controller file code
class Search extends CI_Controller {
function searchname()
{
$this->load->model("car_model");
$data['records'] = $this->car_model->getAllRecords();
$this->load->view('header_view');
$this->load->view('search',$data);
$this->load->view('footer_view');
}
}
?>
view file code
foreach($records as $row):
?>
endforeach;
?>
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Dipankar BiswasRank #992 · 2K reputationPosted Sep 4, 2014, 5:36 AM EDT