[eluser]Unknown[/eluser]
Hi everybody,
New to Code Igniter, I try to display data from a table. My table has two lines, everything is properly returned to the Model or the Controller. But in the view, the table takes only the first line, and divided her into as many rows as columns ...
Here my work :
Code:
public function get_produit_categorie($categorie)
{
$query = $this->db->get_where('produit', array('Categorie_Produit' => $categorie));
return $query->row_array();
}
Code:
if ($categorie == '')
{
$data['produit'] = $this->Produit_Model->get_produit_mise_en_avant();
$data['Titre_Produit'] = 'Barzi Voyages';
}
$this->load->view('templates/header', $data);
$this->load->view('produit/'.$produit, $data);
$this->load->view('templates/footer', $data);
Code:
<?php foreach($produit as $leproduit): ?>
<h2><?php echo $leproduit['Titre_Produit']; ?></h2>
<div id="main">
<?php echo $leproduit['Description_Produit']; ?>
</div>
<p><a href="produit/<?php echo $leproduit['Slug_Produit']; ?>">Voir l'article</a></p>
<?php endforeach ?>
The First row : 1,Vilamendhoo Island Resort,vilamendhoo-island-resort,Cette île est recouverte d’une forêt tropicale, bo...,route-d-europe,0
And that is what I see :
1
1
Voir l'article
V
V
Voir l'article
v
v
Voir l'article
C
C
Voir l'article
r
r
Voir l'article
0
0
Voir l'article
____
Any idea ? Thanks for helping !