In my codeigniter project I have this function in my model
function get_rtc_info($id)
{
$query = $this->db->get_where('rtc_info', array('id' => $id));
$query = $query->row_array();
$query = $query['id'].', '.$query['name'].', '.$query['address']; //line# 313
return $query;
}
I get the following error/warning when running the code
A PHP Error was encountered
Severity: Notice
Message: Undefined index: id , name and address
Filename: models/form_model.php
line number 313
I am not sure why I get this undefined index warnings. Can someone guide me on this error and how to resolve it. Thank you in advance
$quary=$quary->row_array();putdie(var_dump($quary));to see what items it contains.$idthat doesn't exist in the database, or your query is wrong. I'm not familiar with Codeigniter but you should find a way to check if the query returns results. If there no result, don't try to use them.print_r($quary)array(0) { }. @caCtus23 I have the fields in the database, probably my query may be wrong, but It was working some hours ago.CI_DB_mysql_result Object ( [conn_id] => Resource id #35 [result_id] => Resource id #47 [result_array] => Array ( ) [result_object] => Array ( ) [custom_result_object] => Array ( ) [current_row] => 0 [num_rows] => 0 [row_data] => )