Je rencontre un problème avec une de mes fonctions, elle fonctionnait très bien sur mes autres serveur, j'ai vérifié la mémoire memory dans le fichier php.ini tout est correct, j'en conclu donc que ma fonction doit avoir un soucis.
j’espère ne pas vous donner mal à la tête, mais si quelqu'un vois quelque chose d'incohérent
je vais épurer un peu le code pour qu'il soit plus facile à lire
require_once('pannel_conf/connexionPDO.php');
/* ma fonction trop gourmande */
function fabrique_produit_admin($parentId, $proData, $niveau )
{
$niveau++;
$html = '';
if (isset($proData['parents'][$parentId]))
{
foreach ($proData['parents'][$parentId] as $itemId)
{
$html .= "<tr>";
$html .= "<td>***** </td>";
$html .= "<td> *****</td>";
if($proData['items'][$itemId]['mn_parent'] > 0){
$html .= "<td> ***** </td>";
}else{
$idparent = $proData['items'][$itemId]['mn_parent'];
$html .= "<td> ***** </td>";
}
$html .= "<td > ***** </td>";
$html .= "<td> ***** </td>";
$html.= "</tr>";
$html .= fabrique_produit_admin($itemId, $proData, $niveau );
}
}
return $html;
}
/* requete pour générer mes tableaux */
$query = ' SELECT * FROM
source_menu
ORDER BY
mn_id, bouton, valide';
$prep = $db->prepare($query);
$prep->execute();
$nbresult = $prep->rowCount();
echo $nbresult. "<br/> résultat(s) trouvé(s)<br/>";
$proData= array(
'items' => array(),
'parents' => array() ,
'val' => array()
);
while($row=$prep->fetch(PDO::FETCH_ASSOC))
{
$proData['items'][$row['mn_id']] = $row;
$proData['parents'][$row['mn_parent']][] = $row['mn_id'];
$proData['val'][$row['mn_parent']][] = $row['valide'];
$proData['val'][$row['mn_parent']][] = $row['bouton'];
$proData['val'][$row['mn_parent']][] = $row['mn_parent'];
} // fin du while
/* affichage de mon tableau*/
echo fabrique_produit_admin(0, $proData, 0 );
merci de votre aidedog