i tried this:
function getChildFolders($id) {
$sql = "SELECT `cf_id` FROM `scc_cabinet_folders` WHERE `cf_parent_id`= '$id'";
//echo $sql;
$result = mysql_query($sql) or die(mysql_error());
$ret = array();
while ($row = mysql_fetch_array($result)) {
$ret[] = getChildFolders($row['cf_parent_id']);
}
return $ret;
}
getChildFolders(1);
but this script just seems to run in an infinite loop, whats going wrong?
BTW, the id i need is cf_id and the parent id is ... parent_id
Any help would be much appreciated