never written before recursion (in fact, think, the algorithm completely no concept), just have this demand, try to write a bit, found also quite easy, special record.
The database is dedecms default, Dede_arctype is the table to save the column, Reid is the column's parent column ID.
$array Array (); Get_sons ($type$array); Var_dump ($array); function get_sons ($type, &$current _array) { $result mysql_query("SELECT ID from dede_arctype where reid = {$type}"); while ($rowmysql_fetch_assoc($result)) { $current _array $row [' ID ']; Get_sons ($row$current _array);} }
http://www.bkjia.com/PHPjc/770662.html www.bkjia.com true http://www.bkjia.com/PHPjc/770662.html techarticle never written before recursion (in fact, think, the algorithm completely no concept), just have this demand, try to write a bit, found also quite easy, special record. Database is de ...