|
|
|
ขอแนวทางในการเขียนโค้ดดักข้อมูลที่ต้องการนับในฟิวหน่อยครับ |
|
|
|
|
|
|
|
Code (PHP)
<?php
//while($row = mysql_fetch_array($result)){
$query = "SELECT host_dis, count( host_dis ), type,host_moo FROM host GROUP BY host_dis ";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
$aumper = $row['host_dis'];
$num = $row['count( host_dis )'];
$type = $row['type'];
$host_moo = $row['host_moo'];
switch ($type){
case '1':
$type1 += 1;
break;
case '2':
$type2 += 1;
break;
case '3':
$type3 += 1;
break;
}
echo $type1;
echo $type2;
echo $type3;
}
?>
|
|
|
|
|
Date :
2011-07-25 16:32:40 |
By :
ไวยวิทย์ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณครับ
|
|
|
|
|
Date :
2011-07-25 16:42:44 |
By :
pantip |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
array_push + array_count_values สบายกว่า
|
|
|
|
|
Date :
2011-07-25 20:09:37 |
By :
PlaKriM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เห็นด้วยครับ
|
|
|
|
|
Date :
2011-07-25 20:55:48 |
By :
attaprawat |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|