源代码:
$display = 1004;
$result1 = mysql_query("SELECT id, username FROM users where parentid=$diplay");
$resrow = mysql_fetch_row($result1);
$g = $resrow[0];
$g1 = $resrow[1];
$g2 = $resrow[3]; -error not display
$g3 = $resrow[4];
$g4 = $resrow[5];
echo "ID: $g";
echo "ID: $g2";
echo "ID: $g3";
echo "ID: $g4";
我必须显示 1005、1007、1008 但我只能检索 $g 值:
答:1004丹尼尔
我如何显示其他值 1007,1008
桌子
id ----name ----- parentid
-----------------------------------
1004 daniel 1003
1005 peter 1004
1007 michael 1004
1008 sam 1004
答:
$g
1004
/ \
g2 g3
1005 1007