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!
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
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
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