我已经从表中检索了一些数据。像数组一样
我想要数组是..
$subpro[HardDisk] = array (H1000 => 1200,H500 => 700);
$subpro[Ip] = array (4IP => 400 , 2IP => 200);
$subpro[Ram] = array (..);
$subpro[processor] = array (...);
php代码..
while($row=mysql_fetch_array($res))
{
if(sizeof($subpro[$row['category']]>0)
array_put_to_position($subpro[$row['category']],$row['rate'], 2,$row['name']);
else
$subpro[$row['category']]=array($row['name']=>$row['rate']);
}