salem
svp je veux retire un tableau à partir de ma base de données et ça marche b1
mais le problème c que j'utilise un boucle foreach pour affiche mais il n’affiche rien
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 ------------------------------------------ {foreach from=$list_p item=news} <tr> <td width='150' align='center' >{$news.id}</td><td width='250' align='center' >{$news.nom}</td><td width='150' align='center' > {$news.prenom} </td> <td width='150' align='center' > {$news.tel}</td><td width='150' align='center' >{$news.email}</td> <td width='150' align='center' >{$news.date_ajout}</td> <td width=150 align=center ><a href="modifie.php?id={$news.id}"><input type="submit" name="edit" value="Modifier" > </a></td><td width=150 align=center ><a href="supp.php?id={$news.id}"><input type="submit" name="delete" value="Supprimer" onClick="return confirmation();" /></a></td></tr> {/foreach} -------------------------------------------- liste.php: -------------------- $list_personnes = array(); $i = 0; while($data = mysql_fetch_assoc($result)){ $list_personnes[$i]['id'] = $data['id']; $list_personnes[$i]['nom'] = $data['nom']; $list_personnes[$i]['prenom'] = $data['prenom']; $list_personnes[$i]['tel'] = $data['tel']; $list_personnes[$i]['email'] = $data['email']; $list_personnes[$i]['date_ajout'] = $data['date_ajout']; $i++; } // On lance Smarty //echo $list_personnes[1]['id']; $smarty->assign('list_p', $list_personnes);
Partager