[eluser]Solarpitch[/eluser]
Hey,
When I try to call the test function in the below model, I get the error...
Severity: Notice
Message: Undefined variable: callan_db
Filename: models/report_model.php
Dont really understand considering the variable is defined and I've set up the callan database connection settings correctly.
Code:
class Report_model extends Model {
function Report_model()
{
parent::Model();
$callan_db = $this->load->database('callan', TRUE);
}
function test()
{
$query = $callan_db->query("SELECT * FROM golfpro_barsales");
if ($query->num_rows() > 0)
{
$row = $query->row_array();
echo $row['year'];
}
}
}