大家是不是这样取商品分类
时间:2007-02-17 来源:PHP爱好者
PHP代码:--------------------------------------------------------------------------------
// 取商品分类
//**************************************************************************
$result=$db->query("select * from categories where categories_parent_id=0 ORDER BY categories_sort_order");
while($row=$db->fetch_array($result))
{
$categories.=$row[categories_name]."<BR>";
$result2=$db->query("select * from categories where categories_parent_id=$row[categories_id] ORDER BY categories_sort_order");
while($row2=$db->fetch_array($result2))
{
$categories.=$row2[categories_name]."/";
}
$categories.="<BR><BR>";
}
//**************************************************************************
php爱好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
// 取商品分类
//**************************************************************************
$result=$db->query("select * from categories where categories_parent_id=0 ORDER BY categories_sort_order");
while($row=$db->fetch_array($result))
{
$categories.=$row[categories_name]."<BR>";
$result2=$db->query("select * from categories where categories_parent_id=$row[categories_id] ORDER BY categories_sort_order");
while($row2=$db->fetch_array($result2))
{
$categories.=$row2[categories_name]."/";
}
$categories.="<BR><BR>";
}
//**************************************************************************
php爱好者站 http://www.phpfans.net 文章|教程|下载|源码|论坛.
相关阅读 更多 +