|
 |
|
จะนับจำนวนที่ select ออกมาค่ะ ทำงัยค่ะ select ค่าในฐานออกมาได้ 16 แถว แถวละ 12 ค่า ทีนี้จะนับค่า y ในแนวตั้งค่ะ |
|
 |
|
|
 |
 |
|
select ค่าในฐานออกมาได้ 16 แถว แถวละ 12 ค่า ทีนี้จะนับค่า y ในแนวตั้งค่ะ
จากภาพ ผลลัพธ์ ต้องได้ 0,0,0,0,0,0,0,0,0,11,7,11 ค่ะ นับงัยอ่ะค่ะ

Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-03-28 18:19:03 |
By :
pumhonda |
View :
865 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$str[0] = 'xxxxxxxxxyyy';
$str[] = 'xxxxxxxxxyxy';
$str[] = 'xxxxxxxxxyyy';
$str[] = 'xxxxxxxxxxyy';
$str[] = 'xxxxxxxxxyxy';
$str[] = 'xxxxxxxxxyxx';
$str[] = 'xxxxxxxxxxyy';
$str[] = 'xxxxxxxxxyxy';
$str[] = 'xxxxxxxxxyyy';
$str[] = 'xxxxxxxxxyxx';
$str[] = 'xxxxxxxxxxxy';
$str[] = 'xxxxxxxxxxxx';
$c=0;
function sprit($str){
for($i=0;$i<count($str);$i++){
$cut = str_split($str[$i],1);
$cutnew[$i] = $cut;
}
return $cutnew;
}
$cutnew = sprit($str);
for($i=0;$i<count($str);$i++){
for($j=0;$j<12;$j++){
$str_new[$i] .= $cutnew[$j][$i];
}
}
for($i=0;$i<count($str);$i++)
echo $str_new[$i].'<br/>';
//---> ต่อไปก็ check หาจำนวน Y ใน string แต่่ละชุด (ประมาณนี้หรือป่าวครับ)
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2011-03-28 20:03:41 |
By :
t-monroe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|