Jump to content

Neep help with PHP


jcnorth

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 @ : [email protected]

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.