• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined Offset:0 under Helper

#1
I am encountering an Error:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 0
Filename: helpers/ompty_helper.php
Line Number: 9


Here's line Numer 9: "$resto_web_apps_info = $resto_web_apps_info[0]->$structure;"

The model contains:
function get_resto_web_apps_info($general_id, $web_app_name, $structure){
return $this->db->select('rwi.'.$structure)
->from('restaurant_web_apps_info as rwi')
->join('restaurant_web_apps as r', 'r.id = rwi.restaurant_web_apps_id', 'left outer')
->where('r.web_app_name', $web_app_name)
->where('rwi.general_restaurant_info_id', $general_id)
->get()
->result();
}



I've been calling this function multiple times but I get this only in one part of my code. What could be the possible problem?
Reply

#2
Can you post your helper code .. this error says, that in $resto_web_apps_info[0] is nothing, so you have to check first if your array has a value.

Reply

#3
just try result_array() in your model
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.