Neep help with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jcnorth
Forum Newbie
Posts: 3
Joined: Wed Jul 14, 2010 10:03 am

Neep help with PHP

Post 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
jcnorth
Forum Newbie
Posts: 3
Joined: Wed Jul 14, 2010 10:03 am

Re: Neep help with PHP

Post by jcnorth »

BUMP
buckit
Forum Contributor
Posts: 169
Joined: Fri Jan 01, 2010 10:21 am

Re: Neep help with PHP

Post 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)
jcnorth
Forum Newbie
Posts: 3
Joined: Wed Jul 14, 2010 10:03 am

Re: Neep help with PHP

Post 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
Post Reply