Please help me, I'm a beginner.
Well, I'm with a site with codeigniter, it's showing my recipes perfectly on:
<?php foreach ($receitas as $receita) :?>
Now I want to create a loop that only shows recipes that are in favorites, which in case is another table.
Ineedittoretrievealltheid_receitaoftheloggedinuser,incase35,andtheaboveloopshowsallofthem,withoutshowingtheotherunsavedones.
Moreinformationifyouneedto:
CONTROLLER
publicfunctionfavoritos(){$this->load->model("Receitas_model");
$lista = $this->Receitas_model->buscaTodos();
$dados = array ("receitas" => $lista);
$this->load->view('templates/header');
$this->load->view('receitas/favoritos', $dados);
$this->load->view('templates/footer');
}
MODEL
public function buscaTodos(){
$this->db->order_by('criado','desc');
return $this->db->get("receitas")->result_array();
}
The logged-in user can have multiple recipes saved as favorites, and I need to show only those saved, I do not want to show them all.