Welcome Guest, Not a member yet? Register   Sign In
Attempting my 1st model... but beginning to struggle!
#3

[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?


Messages In This Thread
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-29-2009, 09:50 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-29-2009, 12:31 PM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 05:14 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 05:26 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 05:41 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 05:43 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 05:49 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 08:49 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 10:38 AM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 08:49 PM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-30-2009, 11:40 PM
Attempting my 1st model... but beginning to struggle! - by El Forum - 10-31-2009, 05:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB