CodeIgniter Forums

Full Version: Undefined index: id problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I have a problem in accessing data.After restarting the wampserver there is a problem in query result.
function category(){
$data = $this->electronics_model->general();
$data['query'] = $this->electronics_model->get_category();

function get_category(){
$q = $this->db->get("category");

return $q->result_array();



foreach ($query as $row){

echo $row['cat_id'];
echo $row['cat'];


ERROR Comes here

A PHP Error was encountered

Severity: Notice

Message: Undefined index: id

Filename: includes/test.php

Line Number: 14