I have the following code, and a huge ERROR : Maximum function nesting level of '100' reached, aborting!:
function getTree($id)
{
$arr = array();
$sql ='select * from arboree where parent_id=' . $id;
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$arr[] = array(
"Parinte" => $row["parent_id"],
"Nod" => getTree($row["id"])
);
}
return $arr;
}
getTree(1);
help please!!
mysql_*
functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial. – NullPoiиteя May 16 '13 at 14:26