Page 1 of 1

Neep help with PHP

Posted: Wed Jul 14, 2010 10:07 am
by jcnorth
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

Re: Neep help with PHP

Posted: Wed Jul 14, 2010 10:36 am
by jcnorth
BUMP

Re: Neep help with PHP

Posted: Wed Jul 14, 2010 10:40 am
by buckit
am spitballing here... this seems to be part of a class of some sort and without seeing the entire thing I am not really sure how it all works.

but for the sake of giving you something to try...

replace: if ($langQuery->num_rows() > 0)
with: if (!$langQuery->EOF)

Re: Neep help with PHP

Posted: Wed Jul 14, 2010 10:45 am
by jcnorth
cheers for reply but aint worked i geet this error
Fatal error: Call to a member function result_array() on a non-object in /home/a9433674/public_html/threehundredandsixty/application/models/applicationmodel.php on line 91