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,038

HOME > PHP > PHP Forum > รบกวนถามหน่อยคับ เกี่ยวกับนำมาบวก คิดว่าบวกผิดอยู่นะคับ อยากให้แนะนำหน่อยคับ


[PHP] รบกวนถามหน่อยคับ เกี่ยวกับนำมาบวก คิดว่าบวกผิดอยู่นะคับ อยากให้แนะนำหน่อยคับ

 
Topic : 075799

Guest



รบกวนถามหน่อยคับ เกี่ยวกับนำมาบวก คิดว่าบวกผิดอยู่นะคับ อยากให้แนะนำหน่อยคับ ตอนนี้ไม่แน่ใจว่าผิดตรงไหนคับ มันไม่ได้ ค่าที่ถูกต้องยังผิดอยู่คับ นี้โค๊ดคับ

Code (PHP)
001.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
002.<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/water_template2.dwt.php" codeOutsideHTMLIsLocked="false" -->
003.<head>
004.<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
005.<!-- InstanceBeginEditable name="doctitle" -->
006.<title>Untitled Document</title>
007.<!-- InstanceEndEditable -->
008.<!-- InstanceBeginEditable name="head" -->
009.<style type="text/css">
010.<!--
011..style24 {font-family: AngsanaUPC; font-size: 20px; }
012..style25 {
013.    font-family: AngsanaUPC;
014.    font-size: 22px;
015.    font-weight: bold;
016.    color: #0000FF;
017.}
018..style28 {
019.    font-family: AngsanaUPC;
020.    font-size: 20px;
021.    font-weight: bold;
022.    color: #0000FF;
023.}
024..style30 {font-family: AngsanaUPC; font-size: 20px; font-weight: bold; }
025.-->
026.</style>
027.<!-- InstanceEndEditable -->
028.<style type="text/css">
029.<!--
030.a:link {
031.    color: #0000FF;
032.    text-decoration: none;
033.}
034.a:visited {
035.    color: #0000FF;
036.    text-decoration: none;
037.}
038.a:hover {
039.    color: #FF00FF;
040.    text-decoration: none;
041.}
042.a:active {
043.    color: #FF00FF;
044.    text-decoration: none;
045.}
046..style3 {
047.    color: #FFFFFF;
048.    font-weight: bold;
049.    font-family: AngsanaUPC;
050.    font-size: 22px;
051.}
052..style22 {font-family: AngsanaUPC; font-size: 20px; color: #FFFFFF;}
053.-->
054.</style>
055.</head>
056. 
057.<body>
058. 
059.  <table width="798" height="460" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#C8E2F9">
060.    <tr>
061.      <td height="140"><img src="header3.png" width="798" height="140" /></td>
062.    </tr>
063.    <tr>
064.      <td height="239" valign="top" bgcolor="#E2F2F5"><!-- InstanceBeginEditable name="EditRegion1" -->
065.        <p>&nbsp;</p> 
066. 
067.        <?php
068.        include ('connect.php');
069.       $sql = "SELECT * FROM  receipt ORDER BY cus_id ASC ";
070.        $result = mysql_query($sql);
071.        $num_row = mysql_num_rows($result)
072.        ?>
073.        <form id="form2" name="form2" method="post" action="">
074.          <table width="646" border="1" align="center" cellpadding="1" cellspacing="0">
075.            <tr>
076.              <td colspan="6"><span class="style28">มีข้อมูลรายรับทั้งสิ้น &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;รายการ </span></td>
077.            </tr>
078.            <tr>
079.              <td width="84" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">เลขที่ใบเสร็จ </span></strong></div></td>
080.              <td width="83" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">รหัสผู้ใช้น้ำ</span></strong></div></td>
081.              <td width="162" bgcolor="#A9D2F3"><div align="center"><span class="style30">ชื่อ -นามสกุล </span></div></td>
082.              <td width="107" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ประจำเดือน</span></strong></div></td>
083.              <td width="72" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ปี</span></strong></div></td>
084.              <td width="112" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">จำนวนเงิน (บาท)</span></strong></div></td>
085.            </tr>
086.            <tr> <?php
087.                // ѹ SQL
088.         
089.                 
090.        while ( $rs = mysql_fetch_row( $result ) )
091.        {
092.         
093.         $w_p = $price>=$price ;
094.     $c_u = $price + $price;
095.     $s = $c_u+$w_p;
096.     $s++;
097.         
098.        $cus_id = $rs[2];
099.        $receipt_id = $rs[1];
100.        $cus_name = $rs[3];
101.        $cus_lastname = $rs[4];
102.         
103.        $price = $rs[12];
104.        $month = $rs[14];
105.        $year = $rs[15];
106.         
107.          ?>
108.              <td><div align="center"><span class="style24"><?php echo $receipt_id ?></span></div></td>
109.              <td><div align="center"><span class="style24"><?php echo $cus_id  ?></span></div></td>
110.              <td><div align="center"><span class="style24"><?php echo "$cus_name"."&nbsp;&nbsp;$cus_lastname" ?></span></div></td>
111.              <td><div align="center"><span class="style24"><?php echo $month  ?></span></div></td>
112.              <td><div align="center"><span class="style24"><?php echo $year  ?></span></div></td>
113.              <td><div align="center"><span class="style24"><?php echo $price ?></span></div></td>
114.            </tr> <?php  }?>
115.          </table>
116.          <br />
117.          <table width="308" border="0" align="center" cellpadding="0" cellspacing="0">
118.            <tr>
119.              <td width="308" height="124" valign="top"><fieldset>
120.              <legend><span class="style25">สรุปยอดรายรับเดือนนี้</span></legend>
121.                  <br />
122.                  <table width="254" border="0" align="center">
123.                    <tr>
124.                      <td width="143"><div align="right"><strong><span class="style24">รวมเป็นเงินทั้งสิ้น : </span></strong></div></td>
125.                      <td width="42"><input name="textfield2" type="text" size="7" value="<? echo $s  ?>"/></td>
126.                      <td width="55"><strong><span class="style24">บาท</span></strong></td>
127.                    </tr>
128.                  </table>
129.                  <p>&nbsp;</p>
130.              </fieldset> </td>
131.            </tr>
132.          </table>
133.          <p align="center" class="style28"><a href="index11.php">&lt; กลับหน้าแรก &gt;</a></p>
134.        </form>
135.        <p>&nbsp;</p>
136.      <!-- InstanceEndEditable --></td>
137.    </tr>
138.    <tr>
139.      <td height="30" bgcolor="#3F94E9"><div align="center" class="style22">การประปาหมู่บ้านปากทาง<br />
140.24 &nbsp;ม.13&nbsp;&nbsp; ต.ตลิ่งชัน &nbsp;อ.บันนังสตา &nbsp;จ.ยะลา&nbsp;&nbsp;95130<br />
141.โทรศัพท์ : 081-7983950 </div></td>
142.    </tr>
143.</table>
144. 
145.</body>
146.<!-- InstanceEnd --></html>


/

ที่แสดงอกมา
แต่ผลรวมได้เท่านี้

2

ผิดตรงไหนหรอคับ รบกวนหน่อยคับ



Tag : PHP, MySQL

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-03-19 22:12:55 By : แบงค์ View : 890 Reply : 14
 

 

No. 1

Guest


ไม่ทราบว่ามีใครพอแนะนำได้ไหมคับ ติดอย่ตรงนี้แล้วคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 08:15:21 By : แบงค์
 

 

No. 2

Guest


พี่ๆคับ บอกหน่อยว่าผิดตรงไหนคับ ทำไมถึงออกมาผิดอย่างนี้ ทั้งๆที่มันน่าจะได้ 155 คับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 09:10:36 By : แบงค์
 

 

No. 3



โพสกระทู้ ( 1,521 )
บทความ ( 2 )

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

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

Code (PHP)
1.$sum=0;
2.while ( $rs = mysql_fetch_row( $result ) ){
3. 
4.$sum=$sum+$rs[12]
5. 
6.}
7.echo $sum;

ลองดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 09:35:21 By : Krungsri
 

 

No. 4

Guest


ใส่ตรงบรรทัดไหนคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 09:39:24 By : แบงค์
 

 

No. 5

Guest


ตอบความคิดเห็นที่ : 3 เขียนโดย : Krungsri เมื่อวันที่ 2012-03-20 09:35:21
รายละเอียดของการตอบ ::
จากตัวอย่างนี้นะ คุณก็เอาตัวแปร $sum ไปแสดงตรง "รวมเป็นเงินทั้งสิ้น"
ส่วนตัวแปร $rs[' ชื่อฟิลด์ที่เก็บค่าที่ต้องการบวก '];

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 09:51:08 By : บังเอิญผ่านมาเห็น
 

 

No. 6

Guest


ยังไงคับ ผมเป็นคนเข้าใจอะไรยากคับพี่
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 10:04:14 By : แบงค์
 

 

No. 7



โพสกระทู้ ( 1,521 )
บทความ ( 2 )

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

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

Code (PHP)
001.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
002.<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/water_template2.dwt.php" codeOutsideHTMLIsLocked="false" -->
003.<head>
004.<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
005.<!-- InstanceBeginEditable name="doctitle" -->
006.<title>Untitled Document</title>
007.<!-- InstanceEndEditable -->
008.<!-- InstanceBeginEditable name="head" -->
009.<style type="text/css">
010.<!--
011..style24 {font-family: AngsanaUPC; font-size: 20px; }
012..style25 {
013.    font-family: AngsanaUPC;
014.    font-size: 22px;
015.    font-weight: bold;
016.    color: #0000FF;
017.}
018..style28 {
019.    font-family: AngsanaUPC;
020.    font-size: 20px;
021.    font-weight: bold;
022.    color: #0000FF;
023.}
024..style30 {font-family: AngsanaUPC; font-size: 20px; font-weight: bold; }
025.-->
026.</style>
027.<!-- InstanceEndEditable -->
028.<style type="text/css">
029.<!--
030.a:link {
031.    color: #0000FF;
032.    text-decoration: none;
033.}
034.a:visited {
035.    color: #0000FF;
036.    text-decoration: none;
037.}
038.a:hover {
039.    color: #FF00FF;
040.    text-decoration: none;
041.}
042.a:active {
043.    color: #FF00FF;
044.    text-decoration: none;
045.}
046..style3 {
047.    color: #FFFFFF;
048.    font-weight: bold;
049.    font-family: AngsanaUPC;
050.    font-size: 22px;
051.}
052..style22 {font-family: AngsanaUPC; font-size: 20px; color: #FFFFFF;}
053.-->
054.</style>
055.</head>
056. 
057.<body>
058. 
059.  <table width="798" height="460" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#C8E2F9">
060.    <tr>
061.      <td height="140"><img src="header3.png" width="798" height="140" /></td>
062.    </tr>
063.    <tr>
064.      <td height="239" valign="top" bgcolor="#E2F2F5"><!-- InstanceBeginEditable name="EditRegion1" -->
065.        <p>&nbsp;</p> 
066. 
067.        <?php
068.        include ('connect.php');
069.       $sql = "SELECT * FROM  receipt ORDER BY cus_id ASC ";
070.        $result = mysql_query($sql);
071.        $num_row = mysql_num_rows($result)
072.        ?>
073.        <form id="form2" name="form2" method="post" action="">
074.          <table width="646" border="1" align="center" cellpadding="1" cellspacing="0">
075.            <tr>
076.              <td colspan="6"><span class="style28">มีข้อมูลรายรับทั้งสิ้น &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;รายการ </span></td>
077.            </tr>
078.            <tr>
079.              <td width="84" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">เลขที่ใบเสร็จ </span></strong></div></td>
080.              <td width="83" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">รหัสผู้ใช้น้ำ</span></strong></div></td>
081.              <td width="162" bgcolor="#A9D2F3"><div align="center"><span class="style30">ชื่อ -นามสกุล </span></div></td>
082.              <td width="107" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ประจำเดือน</span></strong></div></td>
083.              <td width="72" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ปี</span></strong></div></td>
084.              <td width="112" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">จำนวนเงิน (บาท)</span></strong></div></td>
085.            </tr>
086.            <tr> <?php
087.                // ѹ SQL
088.        $sum=0;
089.        while ( $rs = mysql_fetch_row( $result ) )
090.        {
091.         
092.         $w_p = $price>=$price ;
093.     $c_u = $price + $price;
094.     $s = $c_u+$w_p;
095.     $s++;
096.         
097.        $cus_id = $rs[2];
098.        $receipt_id = $rs[1];
099.        $cus_name = $rs[3];
100.        $cus_lastname = $rs[4];
101.         
102.        $price = $rs[12];
103.        $month = $rs[14];
104.        $year = $rs[15];
105.        $sum=$sum+$rs[12];
106.          ?>
107.              <td><div align="center"><span class="style24"><?php echo $receipt_id ?></span></div></td>
108.              <td><div align="center"><span class="style24"><?php echo $cus_id  ?></span></div></td>
109.              <td><div align="center"><span class="style24"><?php echo "$cus_name"."&nbsp;&nbsp;$cus_lastname" ?></span></div></td>
110.              <td><div align="center"><span class="style24"><?php echo $month  ?></span></div></td>
111.              <td><div align="center"><span class="style24"><?php echo $year  ?></span></div></td>
112.              <td><div align="center"><span class="style24"><?php echo $price ?></span></div></td>
113.            </tr> <?php  }?>
114.          </table>
115.          <br />
116.          <table width="308" border="0" align="center" cellpadding="0" cellspacing="0">
117.            <tr>
118.              <td width="308" height="124" valign="top"><fieldset>
119.              <legend><span class="style25">สรุปยอดรายรับเดือนนี้</span></legend>
120.                  <br />
121.                  <table width="254" border="0" align="center">
122.                    <tr>
123.                      <td width="143"><div align="right"><strong><span class="style24">รวมเป็นเงินทั้งสิ้น : </span></strong></div></td>
124.                      <td width="42"><input name="textfield2" type="text" size="7" value="<?php echo $sum;  ?>"/></td>
125.                      <td width="55"><strong><span class="style24">บาท</span></strong></td>
126.                    </tr>
127.                  </table>
128.                  <p>&nbsp;</p>
129.              </fieldset> </td>
130.            </tr>
131.          </table>
132.          <p align="center" class="style28"><a href="index11.php">&lt; กลับหน้าแรก &gt;</a></p>
133.        </form>
134.        <p>&nbsp;</p>
135.      <!-- InstanceEndEditable --></td>
136.    </tr>
137.    <tr>
138.      <td height="30" bgcolor="#3F94E9"><div align="center" class="style22">การประปาหมู่บ้านปากทาง<br />
139.24 &nbsp;ม.13&nbsp;&nbsp; ต.ตลิ่งชัน &nbsp;อ.บันนังสตา &nbsp;จ.ยะลา&nbsp;&nbsp;95130<br />
140.โทรศัพท์ : 081-7983950 </div></td>
141.    </tr>
142.</table>
143. 
144.</body>
145.<!-- InstanceEnd --></html>



ประวัติการแก้ไข
2012-03-20 10:11:44
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 10:10:21 By : Krungsri
 

 

No. 8



โพสกระทู้ ( 1,521 )
บทความ ( 2 )

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

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

บรรทัดที่ 88,105,124
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 10:14:19 By : Krungsri
 

 

No. 9

Guest


ขอบคุณมากคับได้แล้ววว
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 10:18:53 By : แบงค์
 

 

No. 10

Guest


ขอรบกวนอีกนิดนะคับ จะเพิ่มการค้นหาเข้าไปคับ โดยค้นหาจากเดือน ปี คับ แต่ในฐานที่เก็บ ฟิวส์ date_after เป็น 11/11/2555 คับ ได้ทราบว่าต้องแก้ตรงไหนคับ หรือเพิ่มส่วนไหนคับ ขอบคุณคับ

โค๊ดคับCode (PHP)
001.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
002.<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/water_template2.dwt.php" codeOutsideHTMLIsLocked="false" -->
003.<head>
004.<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
005.<!-- InstanceBeginEditable name="doctitle" -->
006.<title>Untitled Document</title>
007.<!-- InstanceEndEditable -->
008.<!-- InstanceBeginEditable name="head" -->
009.<style type="text/css">
010.<!--
011..style24 {font-family: AngsanaUPC; font-size: 20px; }
012..style25 {
013.    font-family: AngsanaUPC;
014.    font-size: 22px;
015.    font-weight: bold;
016.    color: #0000FF;
017.}
018..style28 {
019.    font-family: AngsanaUPC;
020.    font-size: 20px;
021.    font-weight: bold;
022.    color: #0000FF;
023.}
024..style30 {font-family: AngsanaUPC; font-size: 20px; font-weight: bold; }
025.-->
026.</style>
027.<!-- InstanceEndEditable -->
028.<style type="text/css">
029.<!--
030.a:link {
031.    color: #0000FF;
032.    text-decoration: none;
033.}
034.a:visited {
035.    color: #0000FF;
036.    text-decoration: none;
037.}
038.a:hover {
039.    color: #FF00FF;
040.    text-decoration: none;
041.}
042.a:active {
043.    color: #FF00FF;
044.    text-decoration: none;
045.}
046..style3 {
047.    color: #FFFFFF;
048.    font-weight: bold;
049.    font-family: AngsanaUPC;
050.    font-size: 22px;
051.}
052..style22 {font-family: AngsanaUPC; font-size: 20px; color: #FFFFFF;}
053.-->
054.</style>
055.</head>
056. 
057.<body>
058. 
059.  <table width="798" height="460" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#C8E2F9">
060.    <tr>
061.      <td height="140"><img src="header3.png" width="798" height="140" /></td>
062.    </tr>
063.    <tr>
064.      <td height="239" valign="top" bgcolor="#E2F2F5"><!-- InstanceBeginEditable name="EditRegion1" -->
065.        <p>&nbsp;</p> 
066. 
067.        <p>
068.          <?php
069.        include ('connect.php');
070.       $sql = "SELECT * FROM  receipt ORDER BY cus_id ASC ";
071.        $result = mysql_query($sql);
072.        $num_row = mysql_num_rows($result)
073.        ?>
074.      </p>
075.        <form id="form1" name="form1" method="post" action="12.php">
076.          <table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
077.            <tr>
078.              <td width="540" height="124" valign="top"><fieldset>
079.                <legend><span class="style25">ค้นหาข้อมูลรายรับค่าน้ำ</span></legend>
080.                <br />
081.                <table width="480" border="0" align="center">
082.                  <tr>
083.                    <td width="86"><div align="right" class="style24">เลือกเดือน :</div></td>
084.                    <td width="105"><select name="select">
085.                        <option value="มกราคม">มกราคม</option>
086.                        <option value="กุมภาพันธ์">กุมภาพันธ์</option>
087.                        <option value="มีนาคม">มีนาคม</option>
088.                        <option value="เมษายน">เมษายน</option>
089.                        <option value="พฤษภาคม">พฤษภาคม</option>
090.                        <option value="มิถุนายน">มิถุนายน</option>
091.                        <option value="กรกฎาคม">กรกฎาคม</option>
092.                        <option value="สิงหาคม">สิงหาคม</option>
093.                        <option value="กันยายน">กันยายน</option>
094.                        <option value="ตุลาคม">ตุลาคม</option>
095.                        <option value="พฤศจิกายน">พฤศจิกายน</option>
096.                        <option value="ธันวาคม">ธันวาคม</option>
097.                    </select></td>
098.                    <td width="54"><div align="right" class="style24">เลือกปี : </div></td>
099.                    <td width="104"><select name="select2">
100.                        <option value="2555">2555</option>
101.                        <option value="2556" selected="selected">2556</option>
102.                        <option value="2557">2557</option>
103.                    </select></td>
104.                    <td width="109"><input type="submit" name="Submit" value="แสดงข้อมูล" /></td>
105.                  </tr>
106.                </table>
107.                <p>&nbsp;</p>
108.                </fieldset>
109.                   
110.              </td>
111.            </tr>
112.          </table>
113.      </form>
114.        <form id="form2" name="form2" method="post" action="">
115.          <table width="646" border="1" align="center" cellpadding="1" cellspacing="0">
116.            <tr>
117.              <td colspan="6"><span class="style28">มีข้อมูลรายรับทั้งสิ้น &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;รายการ </span></td>
118.            </tr>
119.            <tr>
120.              <td width="84" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">เลขที่ใบเสร็จ </span></strong></div></td>
121.              <td width="83" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">รหัสผู้ใช้น้ำ</span></strong></div></td>
122.              <td width="162" bgcolor="#A9D2F3"><div align="center"><span class="style30">ชื่อ -นามสกุล </span></div></td>
123.              <td width="107" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ประจำเดือน</span></strong></div></td>
124.              <td width="72" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">ปี</span></strong></div></td>
125.              <td width="112" bgcolor="#A9D2F3"><div align="center"><strong><span class="style24">จำนวนเงิน (บาท)</span></strong></div></td>
126.            </tr>
127.            <tr> <?php
128.                // ѹ SQL
129.        $sum=0;
130.        while ( $rs = mysql_fetch_row( $result ) )
131.        {
132.         
133.         $w_p = $price>=$price ;
134.     $c_u = $price + $price;
135.     $s = $c_u+$w_p;
136.     $s++;
137.         
138.        $cus_id = $rs[2];
139.        $receipt_id = $rs[1];
140.        $cus_name = $rs[3];
141.        $cus_lastname = $rs[4];
142.         
143.        $price = $rs[12];
144.        $month = $rs[14];
145.        $year = $rs[15];
146.        $sum=$sum+$rs[12];
147.          ?>
148.              <td><div align="center"><span class="style24"><?php echo $receipt_id ?></span></div></td>
149.              <td><div align="center"><span class="style24"><?php echo $cus_id  ?></span></div></td>
150.              <td><div align="center"><span class="style24"><?php echo "$cus_name"."&nbsp;&nbsp;$cus_lastname" ?></span></div></td>
151.              <td><div align="center"><span class="style24"><?php echo $month  ?></span></div></td>
152.              <td><div align="center"><span class="style24"><?php echo $year  ?></span></div></td>
153.              <td><div align="center"><span class="style24"><?php echo $price ?></span></div></td>
154.            </tr> <?php  }?>
155.          </table>
156.          <br />
157.          <table width="308" border="0" align="center" cellpadding="0" cellspacing="0">
158.            <tr>
159.              <td width="308" height="124" valign="top"><fieldset>
160.              <legend><span class="style25">สรุปยอดรายรับเดือนนี้</span></legend>
161.                  <br />
162.                  <table width="254" border="0" align="center">
163.                    <tr>
164.                      <td width="143"><div align="right"><strong><span class="style24">รวมเป็นเงินทั้งสิ้น : </span></strong></div></td>
165.                      <td width="42"><input name="textfield2" type="text" size="7" value="<?php echo $sum;  ?>"/></td>
166.                      <td width="55"><strong><span class="style24">บาท</span></strong></td>
167.                    </tr>
168.                  </table>
169.                  <p>&nbsp;</p>
170.              </fieldset> </td>
171.            </tr>
172.          </table>
173.          <p align="center" class="style28"><a href="index11.php">&lt; กลับหน้าแรก &gt;</a></p>
174.        </form>
175.        <p>&nbsp;</p>
176.      <!-- InstanceEndEditable --></td>
177.    </tr>
178.    <tr>
179.      <td height="30" bgcolor="#3F94E9"><div align="center" class="style22">การประปาหมู่บ้านปากทาง<br />
180.24 &nbsp;ม.13&nbsp;&nbsp; ต.ตลิ่งชัน &nbsp;อ.บันนังสตา &nbsp;จ.ยะลา&nbsp;&nbsp;95130<br />
181.โทรศัพท์ : 081-7983950 </div></td>
182.    </tr>
183.</table>
184. 
185.</body>
186.<!-- InstanceEnd --></html>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 10:20:41 By : แบงค์
 

 

No. 11

Guest


ช่วยหน่อยคับพี่ ตามที่ถามเลยคับ ว่ายังไงแบบไหน หรือว่า ผมเขียนแปลกไปหรือคับ ขอโทษด้วยนะคับมือใหม่คับผม แต่อยากให้พี่ๆแนะนำหน่อยคับ ว่ายังไต่อคับ ผมเขียนไว้แล้ว แต่มันไม่ออกมาตามเงื่อนไขคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-20 13:45:55 By : แบงค์
 

 

No. 12

Guest


พี่ๆคับ ขอให้ช่วยผมอีกนิดนะคับ ผมติดอยู่ที่นิดเดียวแล้วคับ ไม่ทราบว่าต้องแก้ไขยังไงคับถึงจะค้นหาได้คับ ผมงง สับสนหมดแล้วคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-21 09:08:49 By : แบงค์
 

 

No. 13

Guest


พี่ๆคับ หรือว่าผม ถามยากเกินไปคับ แล้วต้องแก้ไข ยังไงคับกับสิ่งที่ผมสร้างมาแล้วคับ รบกวนด้วยคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-21 09:59:10 By : แบงค์
 

 

No. 14

Guest


ไม่มีใครช่วยเลยหรออออออออออออออออ TT____________TT
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-03-21 17:06:14 By : แบงค์
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





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