During my coding I really got stuck into this problem. I ran a foreach loop and for every item I had to get a certain value from a function. But I got only one ret
foreach
if($pid!=0) { get_parent_id($table,$parent,$pid); }
You call the function, but never use its value.