Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ช่วยแนะนำหน่อยคับ ต้องการให้มันออกมาสวยคับ ไม่รุ้จะต้องทำไงดี



 

ช่วยแนะนำหน่อยคับ ต้องการให้มันออกมาสวยคับ ไม่รุ้จะต้องทำไงดี

 



Topic : 046749

Guest




ต้องการให้มันแสดง ออกมาแบบนี้คับ ไม่รู้ทำไงดี
vv
bb

นี้โค๊ดคับ

bb

ช่วยด้วยนะคับ



Tag : PHP, Ms SQL Server 2005, CakePHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-08-08 19:55:13 By : คนไม่เก่ง View : 1195 Reply : 37
 

 

No. 1

Guest


ขอโทษทีคับ นี้โค๊ดคับ
<!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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body>
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<?
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
$count_male_all = mysql_result($query,0,'count_male_all'); // ผู้ชายทั้งหมด
echo "<p><strong>เพศชาย มีทั้งหมด ".$count_male_all." คน </strong></p>";
$count_male_20 = mysql_result($query,0,'count_male_20'); // ผู้ชายผอม
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ผอม ".$count_male_20." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_25 = mysql_result($query,0,'count_male_25'); // ผู้ชายปกติ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ปกติ ".$count_male_25." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_29 = mysql_result($query,0,'count_male_29'); // ผู้ชายอ้วน
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วน ".$count_male_29." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_mex = mysql_result($query,0,'count_male_mex'); // ผู้ชายอ้วนมากๆ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วนมากๆ ".$count_male_mex." คน "; // ผู้ชายทั้งหมด ...

$count_female_all = mysql_result($query,0,'count_female_all'); // ผู้หญิงทั้งหมด
echo "<p><strong>เพศหญิง มีทั้งหมด ".$count_female_all." คน</strong></p>"; // ผู้หญิงทั้งหมด ...
$count_female_20 = mysql_result($query,0,'count_female_20'); // ผู้หญิงผอม
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ผอม ".$count_female_20." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_25 = mysql_result($query,0,'count_female_25'); // ผู้หญิงปกติ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ปกติ ".$count_female_25." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_29 = mysql_result($query,0,'count_female_29'); // ผู้หญิงอ้วน
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วน ".$count_female_29." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_mex = mysql_result($query,0,'count_female_mex'); // ผู้หญิงอ้วนมากๆ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วนมากๆ ".$count_female_mex." คน"; // ผู้ชายทั้งหมด ...
}
##################################################################
if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
$count_1to12_all = mysql_result($query,0,'count_1to12_all'); // อายุ 0-12 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 0 - 12 มีทั้งหมด ".$count_1to12_all." คน&nbsp;&nbsp;"; //
$count_1to12_20 = mysql_result($query,0,'count_1to12_20'); // อายุ 0-12 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_1to12_20. " คน&nbsp;&nbsp;";
$count_1to12_25 = mysql_result($query,0,'count_1to12_25'); // อายุ 0-12 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_1to12_25. " คน&nbsp;&nbsp;";
$count_1to12_29 = mysql_result($query,0,'count_1to12_29'); // อายุ 0-12 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_1to12_29. " คน&nbsp;&nbsp;";
$count_1to12_mex = mysql_result($query,0,'count_1to12_mex'); // อายุ 0-12 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_1to12_mex. " คน <br><br>";
//13 - 19
$count_13to19_all = mysql_result($query,0,'count_13to19_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 13 - 19 มีทั้งหมด ".$count_13to19_all." คน&nbsp;&nbsp;"; //
$count_13to19_20 = mysql_result($query,0,'count_13to19_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_13to19_20. " คน&nbsp;&nbsp;";
$count_13to19_25 = mysql_result($query,0,'count_13to19_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_13to19_25. " คน&nbsp;&nbsp;";
$count_13to19_29 = mysql_result($query,0,'count_13to19_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_13to19_29. " คน&nbsp;&nbsp;";
$count_13to19_mex = mysql_result($query,0,'count_13to19_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_13to19_mex. " คน<br><br>";
//20 - 54
$count_20to54_all = mysql_result($query,0,'count_20to54_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 20 - 54 มีทั้งหมด ".$count_20to54_all." คน&nbsp;&nbsp;"; //
$count_20to54_20 = mysql_result($query,0,'count_20to54_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_20to54_20. " คน&nbsp;&nbsp;";
$count_20to54_25 = mysql_result($query,0,'count_20to54_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_20to54_25. " คน&nbsp;&nbsp;";
$count_20to54_29 = mysql_result($query,0,'count_20to54_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_20to54_29. " คน&nbsp;&nbsp;";
$count_20to54_mex = mysql_result($query,0,'count_20to54_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_20to54_mex. " คน<br><br>";
//55 - 100
$count_55to100_all = mysql_result($query,0,'count_55to100_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 55 - 100 มีทั้งหมด ".$count_55to100_all." คน&nbsp;&nbsp;"; //
$count_55to100_20 = mysql_result($query,0,'count_55to100_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_55to100_20. " คน&nbsp;&nbsp;";
$count_55to100_25 = mysql_result($query,0,'count_55to100_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_55to100_25. " คน&nbsp;&nbsp;";
$count_55to100_29 = mysql_result($query,0,'count_55to100_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_55to100_29. " คน&nbsp;&nbsp;";
$count_55to100_mex = mysql_result($query,0,'count_55to100_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_55to100_mex. " คน<br>";
}

?>
</div></td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>
</body>
</html>






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-08 20:04:42 By : เด็กไม่เก่ง
 


 

No. 2

Guest


ขอร้่องงงงงงงงงงละคับ ผมต้องการจริๆงคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-08 20:46:04 By : เด็กไม่เก่ง
 

 

No. 3

Guest


พี่ๆคับช่วยสน่อยคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-09 10:09:47 By : เด็กมัยเก่ง
 


 

No. 4

Guest


ทำไงดี พี่ๆไม่ช่วยสอนผมคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-09 14:08:25 By : เด็กไม่เก่ง
 


 

No. 5

Guest


ทไงดัคับ ให้มันแสดงออกมาเป็นดังที่ถามไว้คับ ช่วยด้วยคับบบบบบบบบบบบบบบบ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-09 15:11:45 By : เด็กไม่เก่ง
 


 

No. 6

Guest


พี่ๆคับ ช่วยยยยยยยยยยยยยยด้วยยยยยยยยยยยยยยยยยยย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-09 22:55:09 By : เด็กไม่เก่ง
 


 

No. 7



โพสกระทู้ ( 51 )
บทความ ( 0 )



สถานะออฟไลน์


แก้ไข script เดิมให้นะครับเด๋วไม่เข้าใจเอา

ไม่ได้หรือติดปัญหาก็ลองถามมาใหม่นะครับ

<!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>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>

<body>
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td>

<!--แก้ไขเป็น jummenu-->
<select name="selects" id="selects" onchange="MM_jumpMenu('parent',this,0)">
<option value="0">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<?
$selects = $_POST['selects']; //การสร้างตัวแปรพยายามอย่าใช้ keyword นะครับ
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($selects=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
$count_male_all = mysql_result($query,0,'count_male_all'); // ผู้ชายทั้งหมด
echo "<p><strong>เพศชาย มีทั้งหมด ".$count_male_all." คน </strong></p>";
$count_male_20 = mysql_result($query,0,'count_male_20'); // ผู้ชายผอม
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ผอม ".$count_male_20." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_25 = mysql_result($query,0,'count_male_25'); // ผู้ชายปกติ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ปกติ ".$count_male_25." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_29 = mysql_result($query,0,'count_male_29'); // ผู้ชายอ้วน
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วน ".$count_male_29." คน<br>"; // ผู้ชายทั้งหมด ...
$count_male_mex = mysql_result($query,0,'count_male_mex'); // ผู้ชายอ้วนมากๆ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วนมากๆ ".$count_male_mex." คน "; // ผู้ชายทั้งหมด ...

$count_female_all = mysql_result($query,0,'count_female_all'); // ผู้หญิงทั้งหมด
echo "<p><strong>เพศหญิง มีทั้งหมด ".$count_female_all." คน</strong></p>"; // ผู้หญิงทั้งหมด ...
$count_female_20 = mysql_result($query,0,'count_female_20'); // ผู้หญิงผอม
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ผอม ".$count_female_20." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_25 = mysql_result($query,0,'count_female_25'); // ผู้หญิงปกติ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์ปกติ ".$count_female_25." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_29 = mysql_result($query,0,'count_female_29'); // ผู้หญิงอ้วน
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วน ".$count_female_29." คน<br>"; // ผู้ชายทั้งหมด ...
$count_female_mex = mysql_result($query,0,'count_female_mex'); // ผู้หญิงอ้วนมากๆ
echo "&nbsp;&nbsp; - อยู่ในเกณฑ์อ้วนมากๆ ".$count_female_mex." คน"; // ผู้ชายทั้งหมด ...
}
##################################################################
if($selects=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
$count_1to12_all = mysql_result($query,0,'count_1to12_all'); // อายุ 0-12 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 0 - 12 มีทั้งหมด ".$count_1to12_all." คน&nbsp;&nbsp;"; //
$count_1to12_20 = mysql_result($query,0,'count_1to12_20'); // อายุ 0-12 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_1to12_20. " คน&nbsp;&nbsp;";
$count_1to12_25 = mysql_result($query,0,'count_1to12_25'); // อายุ 0-12 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_1to12_25. " คน&nbsp;&nbsp;";
$count_1to12_29 = mysql_result($query,0,'count_1to12_29'); // อายุ 0-12 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_1to12_29. " คน&nbsp;&nbsp;";
$count_1to12_mex = mysql_result($query,0,'count_1to12_mex'); // อายุ 0-12 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_1to12_mex. " คน <br><br>";
//13 - 19
$count_13to19_all = mysql_result($query,0,'count_13to19_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 13 - 19 มีทั้งหมด ".$count_13to19_all." คน&nbsp;&nbsp;"; //
$count_13to19_20 = mysql_result($query,0,'count_13to19_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_13to19_20. " คน&nbsp;&nbsp;";
$count_13to19_25 = mysql_result($query,0,'count_13to19_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_13to19_25. " คน&nbsp;&nbsp;";
$count_13to19_29 = mysql_result($query,0,'count_13to19_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_13to19_29. " คน&nbsp;&nbsp;";
$count_13to19_mex = mysql_result($query,0,'count_13to19_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_13to19_mex. " คน<br><br>";
//20 - 54
$count_20to54_all = mysql_result($query,0,'count_20to54_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 20 - 54 มีทั้งหมด ".$count_20to54_all." คน&nbsp;&nbsp;"; //
$count_20to54_20 = mysql_result($query,0,'count_20to54_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_20to54_20. " คน&nbsp;&nbsp;";
$count_20to54_25 = mysql_result($query,0,'count_20to54_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_20to54_25. " คน&nbsp;&nbsp;";
$count_20to54_29 = mysql_result($query,0,'count_20to54_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_20to54_29. " คน&nbsp;&nbsp;";
$count_20to54_mex = mysql_result($query,0,'count_20to54_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_20to54_mex. " คน<br><br>";
//55 - 100
$count_55to100_all = mysql_result($query,0,'count_55to100_all'); // อายุ 15-18 ทั้งหมด
echo "คนมีอายุอยู่ระหว่าง 55 - 100 มีทั้งหมด ".$count_55to100_all." คน&nbsp;&nbsp;"; //
$count_55to100_20 = mysql_result($query,0,'count_55to100_20'); // อายุ 15-18 ผอม
echo "อยู่ในเกณฑ์ผอม ".$count_55to100_20. " คน&nbsp;&nbsp;";
$count_55to100_25 = mysql_result($query,0,'count_55to100_25'); // อายุ 15-18 ปกติ
echo "อยู่ในเกณฑ์ปกติ ".$count_55to100_25. " คน&nbsp;&nbsp;";
$count_55to100_29 = mysql_result($query,0,'count_55to100_29'); // อายุ 15-18 อ้วน
echo "อยู่ในเกณฑ์อ้วน ".$count_55to100_29. " คน&nbsp;&nbsp;";
$count_55to100_mex = mysql_result($query,0,'count_55to100_mex'); // อายุ 15-18 อ้วนมากๆ
echo "อยู่ในเกณฑ์อ้วนมากๆ ".$count_55to100_mex. " คน<br>";
}

?>
</div></td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>
</body>
</html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 00:13:38 By : modboyit
 


 

No. 8

Guest


มัน error คับพี่ ต้องการให้มันแสดงตามกระทู้คับ ตอนนี้มันแสดงออกมาแบบนี้คับ

oo

มันไม่สวยคับ ต้องทำยังไงคับให้มันแสดงตามลักษณะที่ตั้งกระทู้ไว้คับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 00:41:47 By : เด็กไม่เก่ง
 


 

No. 9



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


ใส่ table เข้าไปครับ นี่ตัวอย่าง

if($selects=="sex"){
?>
<table>
<tr>
<td>เพศ</td>
<td>เกณฑ์</td>
<td>คน</td>
</tr>
<tr>
<td>ชาย</td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td>หญิง</td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>

อีกอันไปทำเองละกัน ตกแต่งสีเองด้วย พิมพ์แค่นี้ก็เมื่อยพอละ หวังว่าจะทำได้นะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 05:57:27 By : PlaKriM
 


 

No. 10

Guest


ถ้าใส่tableนี้เข้าไป นตัวแปรของage จะเป็นสีดำ ไม่สามารถทำได้คับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 11:10:43 By : เด็กฝึกหัด
 


 

No. 11



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


เอาละซิ งามหน้าไหมเนี้ย ไม่ยอมให้เค้าหมด

if($selects=="sex"){
?>
<table>
<tr>
<td>เพศ</td>
<td>เกณฑ์</td>
<td>คน</td>
</tr>
<tr>
<td>ชาย</td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td>หญิง</td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php

อะ หายดำยัง

ปล. ผมว่าคุณทำความเข้าใจ หาความรู้เบื่องต้นเกี่ยวกับ html, php อะไรพวกนี้ก่อนดีไหมครับ นี่ผมแนะนำเป็นแนวทางนะครับ ไม่ใช่เขียนให้หมด กะว่าจะให้ไปทำต่อ

ปล.2 กรุณาเลือกเพศด้วยนะครับ เดี๋ยวค่ะเดี๋ยวครับ เพื่ออะไร แมนรับบ่ได้


ประวัติการแก้ไข
2010-08-10 12:22:42
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 12:21:08 By : PlaKriM
 


 

No. 12



โพสกระทู้ ( 3,748 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

55555 งานเข้าแล้วครับพี่ปลากริม
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 12:23:29 By : Dragons_first
 


 

No. 13

Guest


พี่มันerrorแบบนี้คะ

Parse error: syntax error, unexpected '<' in C:\AppServ\www\hbo\tp.php on line 277

นี้โค๊ดคะ



<!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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body>
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<?
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
?>
<table>
<tr>
<td>เพศ</td>
<td>เกณฑ์</td>
<td>คน</td>
</tr>
<tr>
<td>ชาย</td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td>หญิง</td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
##################################################################
if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
?>
<table width="256">
<tr>
<td>อายุ</td>
<td>เกณฑ์</td>
<td>คน</td>
</tr>
<tr>
<td>1 - 12 </td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td>13 - 19 </td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td>20 - 54 </td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td>55 - 100 </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
?>
</div></td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>
<?
</body>
</html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 13:07:46 By : เด็กไม่เก่ง
 


 

No. 14



โพสกระทู้ ( 46 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณ ผมได้เป้นแนวทางในการ join ข้อมูลเลย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 13:26:00 By : computer_psu031
 


 

No. 15

Guest


ให้ช่วยนะคะ ไม่ได้ให้ก็อป
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 14:48:26 By : เด็กไม่เก่ง
 


 

No. 16



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


ที่แรก
Code (PHP)
<?php
}
##################################################################
if($select=="age"){



ที่สอง
Code (PHP)
</table>
<?php
}
?>
</div></td>


ไ่มไ่ด้ปิด if
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 15:23:40 By : PlaKriM
 


 

No. 17

Guest


พี่ ereor
Parse error: syntax error, unexpected '<' in C:\AppServ\www\hbo\tp.php on line 155
แบบนี้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 16:51:39 By : เด็กไม่เก่ง
 


 

No. 18

Guest


ผิดตรงไหนคะ ช่วยหน่อยคะ
นี้โค๊ดปัจจุบันคะ

<!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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body>
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<?
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
?>
<table width="308" align="center">
<tr>
<td><div align="center"><strong>เพศ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>ชาย</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td><strong>หญิง</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
<FONT size=10>}
</FONT>


##################################################################
if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
?>
<table width="374" align="center">
<tr>
<td><div align="center"><strong>อายุ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>1 - 12 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td><strong>13 - 19 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td><strong>20 - 54 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td><strong>55 - 100</strong> </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
<FONT size=10>}</FONT>
?>

</div></td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>

</body>
</html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-10 23:20:39 By : เด็กฝึกหัด
 


 

No. 19



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

Code (PHP)
<?php
<FONT size=10>}
</FONT> 
?>  <<<,///เพิ่มเข้าไปครับ บรรทัดที่ 157



ประวัติการแก้ไข
2010-08-11 10:16:14
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 10:14:19 By : pob_suwan
 


 

No. 20

Guest


ใส่แล้ว ยังเหมือนเดิม
Parse error: syntax error, unexpected '<' in C:\AppServ\www\hbo\tp.php on line 155
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 10:19:33 By : เด็กฝึกหัด
 


 

No. 21

Guest


ผิดตรงไหนคะ ช่วยด้วยยยยยยยยยยยยยยยยยยยยยย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 11:31:39 By : เด็กฝึกหัด
 


 

No. 22



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


อ้าว quote ผิดอัน

ที่แรก
Quote:
<?php
}
##################################################################
if($select=="age"){




ที่สอง
Quote:
</table>
<?php
}
?>
</div></td>


ไ่มไ่ด้ปิด if
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 11:46:46 By : PlaKriM
 


 

No. 23



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


<FONT size=10>}</FONT>

หมายถึง } อะนะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 11:47:41 By : PlaKriM
 


 

No. 24

Guest


เป็นแบบนี้อีกแล้ว
Parse error: syntax error, unexpected '<' in C:\AppServ\www\hbo\tp.php on line 275
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 13:13:53 By : เด็กฝึกหัด
 


 

No. 25

Guest


ผิดตรงไหนอีกแล้วคะ ช่วยด้วยยยยยยยยยยยยย
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 13:48:29 By : เด็กฝึกหัด
 


 

No. 26



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


เอาโค๊ดมาดูครับ แล้วอย่าลืมครอบด้วย code php ด้วย

Parse error: syntax error, unexpected '<' in C:\AppServ\www\hbo\tp.php on line 275
บอกแบบนี้ใครจะตรัสรู้ละท่าน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 13:49:03 By : PlaKriM
 


 

No. 27

Guest


นี้โค๊ดคะ

<!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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body>
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<?
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
?>
<table width="308" align="center">
<tr>
<td><div align="center"><strong>เพศ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>ชาย</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td><strong>หญิง</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
}


##################################################################

if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
?>
<table width="374" align="center">
<tr>
<td><div align="center"><strong>อายุ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>1 - 12 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td><strong>13 - 19 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td><strong>20 - 54 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td><strong>55 - 100</strong> </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
}


</td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>

</body>
</html>
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 14:07:20 By : เด็กไม่เก่ง
 


 

No. 28



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


กรรม บอกให้ครอบด้วย code php หน่อย แล้วผมจะรู้ไหมเนี้ย 275 มันอยู่บรรทัดไหน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 14:18:14 By : PlaKriM
 


 

No. 29



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body> 
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<? 
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
?>
<table width="308" align="center">
<tr>
<td><div align="center"><strong>เพศ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>ชาย</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td><strong>หญิง</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
} 


##################################################################

if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
?>
<table width="374" align="center">
<tr>
<td><div align="center"><strong>อายุ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>1 - 12 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td><strong>13 - 19 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td><strong>20 - 54 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td><strong>55 - 100</strong> </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
}


</td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>

</body>
</html>




ครอบให้แทนเจ้าของกระทู้ *-* ลำบากคนตอบ ถ้าไม่ครอบ php
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 14:24:50 By : pob_suwan
 


 

No. 30



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

Code (PHP)
<?php 
}
?>



บรรทัดที่ 273 ตัว ?> ไม่ได้ใส่ ครับ

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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body> 
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<? 
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
?>
<table width="308" align="center">
<tr>
<td><div align="center"><strong>เพศ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>ชาย</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td><strong>หญิง</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
} 


##################################################################

if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
?>
<table width="374" align="center">
<tr>
<td><div align="center"><strong>อายุ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>1 - 12 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td><strong>13 - 19 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td><strong>20 - 54 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td><strong>55 - 100</strong> </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
}
?>

</td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>

</body>
</html>


อันนี้แก้โค็ดเพิ่มเข้าไปให้แล้ว ครับ


ประวัติการแก้ไข
2010-08-11 14:31:19
2010-08-11 14:33:22
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 14:30:03 By : pob_suwan
 


 

No. 31



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


ตอบความคิดเห็นที่ : 30 เขียนโดย : pob_suwan เมื่อวันที่ 2010-08-11 14:30:03
รายละเอียดของการตอบ ::
ตามนั้นครับ

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 14:32:35 By : PlaKriM
 


 

No. 32

Guest


พี่คะ มันไม่แสดงค่าที่คนออกมาคะ เป็นเพราะอะไรหรือคะ
yy
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 15:19:55 By : เด็กฝึกหัด
 


 

No. 33



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

Code (PHP)
<tr> 
104.<td><strong>ชาย</strong></td> 
105.<td>ทั้งหมด</td> 
106.<td><?php echo $count_male_all; ?></td>  <<<<<<แกส่วนนี้ดูครับ เป็น  <?php echo "$count_male_all"; ?>
107.</tr> 


ลองแก้แค่ จุด 2 จุดดูก่อน ครับถ้าแสดง ก็ค่อยแก้ ให้หมดดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 15:38:03 By : pob_suwan
 


 

No. 34

Guest


ไม่ออกคะ ยังไม่ออกมาคะพี่ๆ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 16:10:20 By : เด็กฝึกหัด
 


 

No. 35



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

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=windows-874" />
<title>แสดงรายงานสรุปสถิติ</title>
<style type="text/css">
<!--
body {
background-image: url(image/background.gif);
}
-->
</style></head>

<body> 
<center>
<form name="form1" method="post" action="">
<p>&nbsp; </p>
<p>&nbsp;</p>
<table width="448" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><strong>ต้องการแสดงสรุปรายงานสถิติ : </strong></td>
<td><select name="select">
<option value="0" selected="selected">โปรดเลือก</option>
<option value="sex">รายงานสถิติตามเพศ</option>
<option value="age">รายงานสถิติตามอายุ</option>
</select>
&nbsp;&nbsp;<input type="submit" name="button" id="button" value="ตกลง" /></td>
</tr>
</table>
</form>
</center>

<table width="607" height="119" border="0" align="center" cellpadding="1" cellspacing="1">
<tr>
<td><p align="center">
<? 
$select=$_POST[select];
?>
</p>

<div align="left">
<?
$host="localhost";
$user="root";
$pass="123";
$dbname = "cal";
$connect=mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());

$sql = "SELECT*FROM(
SELECT
(select count(*) from bmi_db where sex = 'male') as count_male_all,

(select count(*) from bmi_db where sex = 'male' and BMI <20 ) as count_male_20,
(select count(*) from bmi_db where sex = 'male' and BMI >=20 and BMI <25 ) as count_male_25,
(select count(*) from bmi_db where sex = 'male' and BMI >=25 and BMI <29 ) as count_male_29,
(select count(*) from bmi_db where sex = 'male' and BMI >=29 ) as count_male_mex,

(select count(*) from bmi_db where sex = 'female') as count_female_all,
(select count(*) from bmi_db where sex = 'female' and BMI <20 ) as count_female_20,
(select count(*) from bmi_db where sex = 'female' and BMI >=20 and BMI <25 ) as count_female_25,
(select count(*) from bmi_db where sex = 'female' and BMI >=25 and BMI <29 ) as count_female_29,
(select count(*) from bmi_db where sex = 'female' and BMI >=29 ) as count_female_mex,

(select count(*) from bmi_db where age>=1 and age<=12) as count_1to12_all,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI < 20) as count_1to12_20,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=20 and BMI <25) as count_1to12_25,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=25 and BMI <29) as count_1to12_29,
(select count(*) from bmi_db where age>=1 and age<=12 and BMI >=29) as count_1to12_mex,

(select count(*) from bmi_db where age>=13 and age<=19) as count_13to19_all,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI < 20) as count_13to19_20,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=20 and BMI <25) as count_13to19_25,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=25 and BMI <29) as count_13to19_29,
(select count(*) from bmi_db where age>=13 and age<=19 and BMI >=29) as count_13to19_mex,

(select count(*) from bmi_db where age>=20 and age<=54) as count_20to54_all,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI < 20) as count_20to54_20,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=20 and BMI <25) as count_20to54_25,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=25 and BMI <29) as count_20to54_29,
(select count(*) from bmi_db where age>=20 and age<=54 and BMI >=29) as count_20to54_mex,

(select count(*) from bmi_db where age>=55 and age<=100) as count_55to100_all,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI < 20) as count_55to100_20,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=20 and BMI <25) as count_55to100_25,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=25 and BMI <29) as count_55to100_29,
(select count(*) from bmi_db where age>=55 and age<=100 and BMI >=29) as count_55to100_mex

FROM
bmi_db LIMIT 0,1
)a";
echo" <br>";
$query = mysql_query($sql);
if($select=="sex"){
//echo"เลือก รายงานสถิติตามเพศ <br>";//
$count_male_all = mysql_result($query,0,'count_male_all'); // ผู้ชายทั้งหมด 
$count_male_20 = mysql_result($query,0,'count_male_20'); // ผู้ชายผอม
$count_male_25 = mysql_result($query,0,'count_male_25'); // ผู้ชายปกติ
$count_male_29 = mysql_result($query,0,'count_male_29'); // ผู้ชายอ้วน
$count_male_mex = mysql_result($query,0,'count_male_mex'); // ผู้ชายอ้วนมากๆ

$count_female_all = mysql_result($query,0,'count_female_all'); // ผู้หญิงทั้งหมด
$count_female_20 = mysql_result($query,0,'count_female_20'); // ผู้หญิงผอม
$count_female_25 = mysql_result($query,0,'count_female_25'); // ผู้หญิงปกติ
$count_female_29 = mysql_result($query,0,'count_female_29'); // ผู้หญิงอ้วน
$count_female_mex = mysql_result($query,0,'count_female_mex'); // ผู้หญิงอ้วนมากๆ
?>
<table width="308" align="center">
<tr>
<td><div align="center"><strong>เพศ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>ชาย</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_male_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_male_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_male_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_male_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_male_mex; ?></td>
</tr>
<tr>
<td><strong>หญิง</strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_female_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_female_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_female_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_female_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_female_mex; ?></td>
</tr>
</table>
<?php
} 


##################################################################

if($select=="age"){
//echo"เลือก รายงานสถิติตามอายุ <br>";/
//1-12
$count_1to12_all = mysql_result($query,0,'count_1to12_all'); // อายุ 0-12 ทั้งหมด
$count_1to12_20 = mysql_result($query,0,'count_1to12_20'); // อายุ 0-12 ผอม
$count_1to12_25 = mysql_result($query,0,'count_1to12_25'); // อายุ 0-12 ปกติ
$count_1to12_29 = mysql_result($query,0,'count_1to12_29'); // อายุ 0-12 อ้วน
$count_1to12_mex = mysql_result($query,0,'count_1to12_mex'); // อายุ 0-12 อ้วนมากๆ
//13 - 19 
$count_13to19_all = mysql_result($query,0,'count_13to19_all'); // อายุ 15-18 ทั้งหมด
$count_13to19_20 = mysql_result($query,0,'count_13to19_20'); // อายุ 15-18 ผอม
$count_13to19_25 = mysql_result($query,0,'count_13to19_25'); // อายุ 15-18 ปกติ
$count_13to19_29 = mysql_result($query,0,'count_13to19_29'); // อายุ 15-18 อ้วน
$count_13to19_mex = mysql_result($query,0,'count_13to19_mex'); // อายุ 15-18 อ้วนมากๆ
//20 - 54
$count_20to54_all = mysql_result($query,0,'count_20to54_all'); // อายุ 15-18 ทั้งหมด
$count_20to54_20 = mysql_result($query,0,'count_20to54_20'); // อายุ 15-18 ผอม
$count_20to54_25 = mysql_result($query,0,'count_20to54_25'); // อายุ 15-18 ปกติ
$count_20to54_29 = mysql_result($query,0,'count_20to54_29'); // อายุ 15-18 อ้วน
$count_20to54_mex = mysql_result($query,0,'count_20to54_mex'); // อายุ 15-18 อ้วนมากๆ
//55 - 100
$count_55to100_all = mysql_result($query,0,'count_55to100_all'); // อายุ 15-18 ทั้งหมด
$count_55to100_20 = mysql_result($query,0,'count_55to100_20'); // อายุ 15-18 ผอม
$count_55to100_25 = mysql_result($query,0,'count_55to100_25'); // อายุ 15-18 ปกติ
$count_55to100_29 = mysql_result($query,0,'count_55to100_29'); // อายุ 15-18 อ้วน
$count_55to100_mex = mysql_result($query,0,'count_55to100_mex'); // อายุ 15-18 อ้วนมากๆ
?>
<table width="374" align="center">
<tr>
<td><div align="center"><strong>อายุ</strong></div></td>
<td><div align="center"><strong>เกณฑ์</strong></div></td>
<td><div align="center"><strong>คน</strong></div></td>
</tr>
<tr>
<td><strong>1 - 12 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_1to12_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_1to12_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_1to12_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_1to12_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_1to12_mex; ?></td>
</tr>
<tr>
<td><strong>13 - 19 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_13to19_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_13to19_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_13to19_25;?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_13to19_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_13to19_mex; ?></td>
</tr>
<tr>
<td><strong>20 - 54 </strong></td>
<td>ทั้งหมด</td>
<td><?php echo $count_20to54_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_20to54_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_20to54_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_20to54_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_20to54_mex; ?></td>
</tr>
<tr>
<td><strong>55 - 100</strong> </td>
<td>ทั้งหมด</td>
<td><?php echo $count_55to100_all; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ผอม</td>
<td><?php echo $count_55to100_20; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>ปกติ</td>
<td><?php echo $count_55to100_25; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วน</td>
<td><?php echo $count_55to100_29; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>อ้วนมาก</td>
<td><?php echo $count_55to100_mex; ?></td>
</tr>
</table>
<?php
}
?>

</td>
</tr>
</table>


<p>&nbsp;</p>
<p align="center"><a href="adin.php"><strong>กลับ</strong></a></p>

</body>
</html>


เหมือนลืมส่วนนั้นไปนะ ลองดูครับตามด้านบน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 16:24:10 By : pob_suwan
 


 

No. 36

Guest


ได้แล้วคะ ขอบคุณมากๆคะๆๆๆๆๆๆๆๆๆๆๆๆๆๆๆๆๆๆๆ ขอบคุณจริงๆๆๆๆๆ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 16:29:59 By : เด็กฝึกหัด
 


 

No. 37



โพสกระทู้ ( 82 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter Facebook

ดีใจด้วยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-08-11 16:39:04 By : pob_suwan
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยแนะนำหน่อยคับ ต้องการให้มันออกมาสวยคับ ไม่รุ้จะต้องทำไงดี
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่