i'm very very confuse with my link - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: i'm very very confuse with my link (/showthread.php?tid=48767) |
i'm very very confuse with my link - El Forum - 01-27-2012 [eluser]wasis[/eluser] good morning all of you.Please guys help me to fix my link.. this is my controller.. class Studio extends Controller { function index() { $menu['menu1'] = $this->studio_model->tampil_menu(); $menu['submenu1'] = $this->studio_model->tampil_menu(); $this->load->view('sepakbola',$menu); } } this is my model.. class Studio_model extends Model { ... function tampil_menu(){ $menu1 = $this->db->get_where('menu',array('id_menu'=>1)); $sql_menu1 = $menu1->row(); return $sql_menu1; $submenu1 = $this->db->get_where('submenu',array('id_menu'=>1),3); foreach($submenu1 as $sql_submenu1) { $output1 = $sql_submenu1->nama_submenu; } return output1; } } and this is my link in my view.. <li><a href="index.php?id_submenu=<?=$sql_submenu2['id_submenu']?>"> <?=$submenu2->nama_submenu?></a></li> i've already modify the script many times but it still error. i need your help immediately please guys, i'm still newbie.. this is for my future of my job..:down: i'm very very confuse with my link - El Forum - 01-27-2012 [eluser]Bhashkar Yadav[/eluser] what error you are getting? i'm very very confuse with my link - El Forum - 01-27-2012 [eluser]wasis[/eluser] Severity:4096; message : "object of class stdClass could not be converted to string" Severity:notice; message : "undefined variableql_submenu2" i'm very very confuse with my link - El Forum - 01-27-2012 [eluser]limit[/eluser] Shouldn't it be.. Code: $this->Studio_model->your_function() Also make sure your loading your model - Code: $this->load->model('Studio_model'); i'm very very confuse with my link - El Forum - 01-28-2012 [eluser]Unknown[/eluser] [quote author="wasis" date="1327718850"]Severity:4096; message : "object of class stdClass could not be converted to string" Severity:notice; message : "undefined variableql_submenu2"[/quote] sql_submenu2 => sql_submenu1 |