• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i'm very very confuse with my link

#1
[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=&lt;?=$sql_submenu2['id_submenu']?&gt;">
&lt;?=$submenu2->nama_submenu?&gt;</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:

#2
[eluser]Bhashkar Yadav[/eluser]
what error you are getting?

#3
[eluser]wasis[/eluser]
Severity:4096;
message : "object of class stdClass could not be converted to string"

Severity:notice;
message : "undefined variableConfusedql_submenu2"

#4
[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');

#5
[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 variableConfusedql_submenu2"[/quote]

sql_submenu2 => sql_submenu1



Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.