...

View Full Version : Problem with recursion



dizyn
11-18-2007, 01:26 PM
I have categories up to n levels and my db is like:
Category: catid,catname,parent

parent = n //where n is the value of parent category




function myFun($id)
{
$res = mysql_query("select * from categories where parent=".$id."") or die("Here is error");
while($row = mysql_fetch_array($res))
{
myFun($row["catid"])
}
}
myFun2(2)

but this is not workin
any help?

thank you

abduraooft
11-18-2007, 02:41 PM
myFun2(2) ?
You have defined myFun($id) only!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum