05-03-2012, 05:26 AM
[eluser]Jason van der Zeeuw[/eluser]
hey all...
I've got this function:
I have the database class loaded automatically in:
I did this after seeing this tutorial:
http://net.tutsplus.com/articles/news/co...tch-day-2/
but still I get some errors:
Message: Undefined property: CI_DB_mysql_result::$result
Message: Invalid argument supplied for foreach()
Message: Undefined variable: resultarray
While I do exactly the same as in the tutorial...
please can anyone help me :$?
hey all...
I've got this function:
Code:
function get_employees($tablename)
{
$result = $this->db->query("Select firstname from {$tablename}");
if($result->num_rows() > 0)
{
foreach ($q->result as $row) {
$resultarray[] = $row;
}
return $resultarray;
}
else
{
return false;
}
}
I have the database class loaded automatically in:
Code:
$autoload['libraries'] = array('database');
I did this after seeing this tutorial:
http://net.tutsplus.com/articles/news/co...tch-day-2/
but still I get some errors:
Message: Undefined property: CI_DB_mysql_result::$result
Message: Invalid argument supplied for foreach()
Message: Undefined variable: resultarray
While I do exactly the same as in the tutorial...
please can anyone help me :$?