<? //include("core.php");
include ("connect_db.php");
echo $sql ="SELECT corepro_id FROM status group by corepro_id ";
$query=mysql_query($sql);
//$cgroupw=$query->recordCount();
$cgroupw=mysql_num_rows($query);
$a=0;
while($groupws = mysql_fetch_array($query))
{
echo $groupw[$a]=$groupws[corepro_id];
$a++;
}
//$cgroupw=count($groupw);
$ic=0;
for($i=0;$i<$cgroupw;$i++)
{
echo $sql1="SELECT coreprol_id FROM status where corepro_id='".$groupw[$i]."' group by coreprol_id";
$query=mysql_query($sql1);
echo $result[$i]=mysql_num_rows($query);
echo "<br>";
for($c=0;$c<$result[$i];$c++)
{
$rows = mysql_fetch_array($query);
echo $w[$i][$c]=$rows['coreprol_id'];
echo $sql12="SELECT*FROM status where corepro_id='".$groupw[$i]."' and coreprol_id='".$w[$i][$c]."' "; \\เพิ่ม
$query2=mysql_query($sql12);
echo "<br>";
echo $xx_result[$i][$c]=mysql_num_rows($query2);
$x_num2=0;