jcnorth Posted July 14, 2010 Share Posted July 14, 2010 Hello i am making a social website for cyclist and got this bit of php code with a package i got and i have checked it but i uploaded it and i get the error below the script can anybody help been trying to figure it out all day :banghead: function getLanguages() { $this->db->select('lang_code, lang_name'); $this->db->from('languages'); $langQuery = $this->db->get(); $languages = array(); if ($langQuery->num_rows() > 0) { foreach ($langQuery->result_array() as $langRow) { $languages[] = $langRow; } } return $languages; Fatal error: Call to a member function num_rows() on a non-object in /home/a9433674/public_html/threehundredandsixty/application/models/applicationmodel.php on line 89 Please respond to this thread email me @ : djcrosby101@hotmail.co.uk skype : djcrosby2 Cheers Quote Link to comment Share on other sites More sharing options...
Adam Posted July 14, 2010 Share Posted July 14, 2010 Which DB library/class are you using? Quote Link to comment Share on other sites More sharing options...
jcnorth Posted July 14, 2010 Author Share Posted July 14, 2010 my sql , php my admin Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 14, 2010 Share Posted July 14, 2010 No. You are using a class for your database operations. I suspect that either an error is occuring during one of the database connection/query commands here: $this->db->select('lang_code, lang_name'); $this->db->from('languages'); $langQuery = $this->db->get(); Or, you are not calling the num_rows function correctly onthis line $langQuery->num_rows() > 0 However, you are using a custom class for these database operations not the common PHP functions. So, it is impossible for anyone to determine the answer from what you have provided unless we understand the 3rd party class that you are using. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.