Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/207725-neep-help-with-php/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/207725-neep-help-with-php/#findComment-1085929
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.