billybrag
Mar 20th 2006, 5:05 am
hello all,
im trying to create a udf that will go through my db and pick up all categories and there sub categories - its for a link directory. I could do it php and i know what i want to do im just not quite up to speed on how to implement it in CFML.
here is the pseudo code of what i want to actually do - its a recursive function to pull everything out in the right place.
funtion process_list( id requireid, int indent )
{
for everything database
{
if(parentid == requiredid)
{
print(name, indent);
int new_indent = indent+1;
process_list(parentid, new_indent );
}
}
}
as you can see parentdid is from the db and indent tells you how deep you are in the categories. required id starts at 0 to say you are at the root of the directory.
can anyone convert this for me as its causeing muchos headaches!!
:)
thanks for any help/ suggestions
im trying to create a udf that will go through my db and pick up all categories and there sub categories - its for a link directory. I could do it php and i know what i want to do im just not quite up to speed on how to implement it in CFML.
here is the pseudo code of what i want to actually do - its a recursive function to pull everything out in the right place.
funtion process_list( id requireid, int indent )
{
for everything database
{
if(parentid == requiredid)
{
print(name, indent);
int new_indent = indent+1;
process_list(parentid, new_indent );
}
}
}
as you can see parentdid is from the db and indent tells you how deep you are in the categories. required id starts at 0 to say you are at the root of the directory.
can anyone convert this for me as its causeing muchos headaches!!
:)
thanks for any help/ suggestions