|
 |
|
ผมจะเอา ค่าใน กรอบสีดำ ไป คูณ กับ ข้อมูลในกรอบสี เขียวได้หรือเปล่า ครับ โดยมีเงื่อนไขแยกตามวันที่ |
|
 |
|
|
 |
 |
|
รบกวน พี่ ๆ ด้วย ครับ ผมจะเอา ค่าใน กรอบสีดำ ไป คูณ กับ ข้อมูลในกรอบสี เขียวได้หรือเปล่า ครับ
โค๊ดนี้ เป็นโค๊ด ที่อยู่ใน กรอบสีดำ
โค๊ดนี้ จะเอาไปคูณ กับ ค่า ในกรอบสีเขียว เช่น 0.000885934939681 * 97934.6591796875
Code (PHP)
$rs_group = mysql_query("SELECT count(order_generation) AS V_TOTAL1 , SUM(size_new) AS V_TOTAL , check_status , order_ID ,order_generation AS V_TOTAL2
FROM genneration_size
WHERE check_status='0' or check_status='1' or check_status='2'
AND order_generation IN ('ASD', 'CSD', 'HRG', 'LBG', 'LSD', 'OBD', 'PFR', 'RAL', 'WSG', '$hdata')
GROUP BY order_generation");
while($row_group = mysql_fetch_array($rs_group))
{
$su_cou[]=$row_group[V_TOTAL2]."<br>"; // HRG
$su_genner[]=$row_group[V_TOTAL1]."<br>"; // จำนวน รุ่น HRG
$su_size[]=$row_group[V_TOTAL]."<br>"; // ขนาดทั้งหมดของ HRG
echo $sum_selec[]=$row_group[V_TOTAL1] / $row_group[V_TOTAL]."<br>";
// $data[]=$row_group[V_TOTAL1];
}
// echo "-------------------------"."<br>";
$summ0=$su_cou[0]."<br>";
$summ1=$su_cou[1]."<br>";
$summ2=$su_cou[2]."<br>";
$summ3=$su_cou[3]."<br>";
$summ4=$su_cou[4]."<br>";
$summ5=$su_cou[5]."<br>";
$summ6=$su_cou[6]."<br>";
$summ7=$su_cou[7]."<br>";
$summ8=$su_cou[8]."<br>";
โค๊ดนี้ เป็นโค๊ด ที่อยู่ใน กรอบสีเขียว ครับ แยกตาม รุ่น ASD , CSD,....และ แยกตาม ปี กับ เดือน ครับ เช่น 2012-12
Code (PHP)
$select_date=mysql_query("SELECT count(order_generation) AS V_TOTAL_new1 , SUM(size_new) AS V_TOTAL_new , DATE_FORMAT(order_date,'%Y-%m') AS Mydate , check_status , order_generation AS V_TOTAL2_
FROM `genneration_size`
WHERE order_generation='$order_generation' IN ('ASD', 'CSD', 'HRG', 'LBG', 'LSD', 'OBD', 'PFR', 'RAL', 'WSG')
Group by DATE_FORMAT(order_date,'%Y-%m') , order_generation");
while($row_qu=mysql_fetch_array($select_date)){
echo $date_0[]=$row_qu[V_TOTAL2_]."<br>";
echo $date_1[]=$row_qu[V_TOTAL_new1]."<br>";
echo $date_2[]=$row_qu[V_TOTAL_new]."<br>"; //ผลรวมของแต่ละเดือน
echo $date_3[]=$row_qu[Mydate]."<br>";
}

Tag : PHP, MySQL, HTML/CSS, JavaScript, iOS, Android

|
ประวัติการแก้ไข 2013-03-29 11:03:20 2013-03-29 11:04:56 2013-03-29 11:10:01 2013-03-29 11:46:37
|
 |
 |
 |
 |
Date :
2013-03-29 11:00:17 |
By :
TonsoR |
View :
765 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คิดว่าน่าจะทำที่ Query ได้น่ะครับ ด้วยการเอามา JOIN และ คูณ กันครับ
|
 |
 |
 |
 |
Date :
2013-03-30 07:33:50 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวน ขอ ตัวอย่างเป็นแนว ทาง ด้วย ครับ เพราะ join table เดียวกัน
|
ประวัติการแก้ไข 2013-03-30 13:23:02
 |
 |
 |
 |
Date :
2013-03-30 13:22:11 |
By :
TonsoR |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|