Welcome Guest, Not a member yet? Register   Sign In
HELP: Recursive creation of categories folder
#1

[eluser]joneslee[/eluser]
Hi everyone,

Can someone show me the algorithm how I could recursively create folder from a 'categories' DB?

My 'categories' table
id -> int (11)
cat_id -> int(11)

the folder I would like to create will based on the 'id'
Please note that 0 is the highest level

Eg 0 ___ 65
|___ 6____|___ 66
|___ 2____ 15

Many thanks,
#2

[eluser]taewoo[/eluser]
just use mkdir()..

Code:
bool mkdir  ( string $pathname  [, int $mode=0777  [, bool $recursive=false  [, resource $context  ]]] )
#3

[eluser]joneslee[/eluser]
Just wondering if you could post the model code to recursively dive into the category table and retrieve all category?




Theme © iAndrew 2016 - Forum software by © MyBB