[eluser]JamesTaylor[/eluser]
i've done some reading on active record as suggested and i still can't get anything working... surely it can't be this difficult!
I have made my sql more basic to try and get something working as a starting point, heres what i have:
Code:
class NextComp extends Model {
function index()
{
$this->db->select('CompName, CompFormat, CompDate');
$this->db->where('CompID', '1');
$this->db->from('clubcompetitions');
$query = $this->db->get();
}
}
if i'm correct this should be selecting:
CompName, CompFormat, CompDate WHERE CompID=1 FROM clubcompetitions
Is there a way to check that my model is actually working at this point??
I now need to pass this retrieved info to the controller so it sits in $data['CompName'], $data['CompFormat'] and $data['CompDate']... this is where i am unsure what i should be doing.
Is the data automatically passed to the controller as it contains the code:
Code:
$this->load->model('NextComp');
or is that just loading the ability to use the model and do i somehow need to pass the info from the model to the controller with further code? and if so, where should that code be placed... in the model or the controller?