. , , ,

,,,

PHP — ,

.

, , " , ... !". , . , .

, , :

| uid | | uid |

,

$s = mysql_query("SELECT * FROM x_table WHERE parent_id=0", $conn);

while ($z = mysql_fetch_array($s)) {

...

$x = mysql_query("SELECT * FROM x_table WHERE parent_id=".$z["uid"], $conn);

while ($f = mysql_fetch_array($x)) {

...

..

}

}

! , , . .. . .

. , 100 , , . ? 100 , . ... (, , ).

-------------------------

. :

function tree($uid, $conn) {

$sql = "SELECT * FROM x_table WHERE parent_id=$uid";

$a = mysql_query($sql, $conn);

while($x = mysql_fetch_array($a)) {

.... - ...

tree($x["uid"], $conn);

}

}

: tree(0, $conn). . .

: - PHP.

http://progcpp.narod.ru/

. , , " , ... !". ,

 

 

 

! , , , .
. , :