[eluser]nubianxp[/eluser]
hey guys, sorry for starting a series of noob posts but I was hoping you could extend some help and patience...
I'm using the world.sql sample and I have the following code inside my controller (just for testing):
Code:
function index() {
$sql = "SELECT * FROM country";
$result = $this->db->query($sql);
$data['country'] = $result->result_array();
$this->load->view('view_main',$data);
}
in my view_main.php
Code:
<ol>
<?php foreach ($country as $country) {?>
<li><?=$country['Name']?>
<ul>
<li><?=$country['Region']?></li>
<li><?=$country['GovernmentForm']?></li>
</ul>
</li>
<?php };?>
</ol>
it's fine right now but how about if I want to pass the $data as
instead, how do I format the logic in the controller?
I apologize, but I've been browsing a lot of resources but I still don't get some of it for the life of me but I'm getting the $data variable concept a bit now. LOL
Thanks for any help.