[eluser]TWP Marketing[/eluser]
[EDIT] Apologies, I misread your question, you do have database access and do want to use a model... I need more coffee. I've changed this reply to access a db table from the model
In the controller:
Code:
...
$data['some_data'] = $this->Mymodel->read_some_table(); // read the db table
...
$this->load_view('myview',$data); // pass the data array to your view where it will be exploded, see below
In the model file mymodel.php
Code:
...
function read_some_table()
{
$query = $this->db->get('some_table_name'); // read all records form the table
if( $query->num_rows() > 0 )
{
return( $query->result_array() ); // return the data as an array
}else{
return( FALSE );
}
}
...
In a view file myview.php:
Code:
...
foreach( $some_data as $key => $value)
{
echo 'This is the array key value: '.$key.'<br />';
echo $value['field_name'].'<br />'; // echo the data element in the view (note that the array $data has been exploded.
echo $value['another_field_name'].'<br />';
}
...
This is VERY basic code and you will find it all in the User Guide...