quant je fait ceci :
php:
$output="";
$tpl = $GLOBALS['tplEngine']->createTemplate('./tpl/download.tpl');
$sql="SELECT * FROM neomega_upload WHERE categorie_id = $id_cat"; //
$res=query($sql);
$val = fetch_assoc($res);
$tpl_results_parent = array();
while ($ligne = fetch_assoc($res)) {
$parent_id=$ligne['parent_id'];
$tpl_results_parent[] = array(
'nom' => $ligne['nom'],
'id' => $ligne['id'],
'parent_id' => $ligne['chemins']);
}
$tpl->assign('results', $tpl_results_parent);
$tpl->assign('STR_BEFORE_TWO_POINTS', $GLOBALS['STR_BEFORE_TWO_POINTS']);
$tpl->assign('wwwroot', $GLOBALS['wwwroot']);
$output .= $tpl->fetch();
}else{
$output="Erreur";
}
et dans mon TPL :
{foreach $results as $res}
{if $res.parent_id == 0}
<a href="{$res.id}" >{$res.nom} => {$res.id} => {$res.parent_id}</a><br>
{else}
<a href="?id_cat={$res.id}" > {$res.nom} => {$res.id} => {$res.parent_id}</a><br>
{/if}
{/foreach}
j'ai a chaque fois une entree de la bdd qui n'apparait pas
une idee ?