• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Message: Undefined property: Teilnehmer::$BookingData

#1
[eluser]Benedikt[/eluser]
Hi,

Im getting this Error:

Quote:Message: Undefined property: Teilnehmer::$BookingData
Fatal error: Call to a member function get_data() on a non-object

In the line where the error is noticed it says:

Code:
$CI = &get;_instance();
  $CI->load->model('bookingdata');
  $CI->load->library('email');

  $data_row = $CI->BookingData->get_data($best_code);
  $club_row = $CI->BookingData->get_club($data_row->tbl_clubs_id);

Its inside a helper-function. The error raises in the last line, $club_row. In this line a model is called which gives back the result of a DB-query:

Code:
function get_data($best_code)
    {
      $query = $this->db->get_where('tbl_teilnehmer', array('best_code' => $best_code));
      $row   = $query->row();

      return $row;;
    }

Any idea what is wrong?

I mean, I see that its a problem to access an object which is not an object, but can I convert $data_row into an object? Or do I need to access it like an array?

#2
[eluser]lukeinjax[/eluser]
I don't think this is the cause of your problem, but you have a double semi-colon on the return statement in get_data. Try removing it and see if it works.

#3
[eluser]lukeinjax[/eluser]
Actually, I think it might have something to do with your naming convention (upper/lower case) of your BookingData model class and how you are referencing it. See 'Loading a Model' on this page: http://ellislab.com/codeigniter/user-gui...odels.html.

#4
[eluser]mdowns[/eluser]
try
Code:
$CI->load->model('bookingdata','BookingData');

#5
[eluser]Benedikt[/eluser]
Thanks guys, it was the upper/lower-case thing.

I renamed $CI->... to the same spelling as $CI->load->...

Now it works.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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