<?php $sql="select * from `".$tb_prefix."deposit` Order by DepositID DESC limit 50 "; $result=mysql_db_query($dbName,$sql); while ($record=mysql_fetch_array($result)){ $DepositID=$record[DepositID]; $Username=$record[Username]; $DepositBank=$record[DepositBank]; $DepositAmount=$record[DepositAmount]; $Channel=$record[Channel]; $Deposittime=$record[Deposittime]; $Staff=$record[Staff]; $Date=$record[Date]; echo" <table width=\"1100\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\"> <tr> <td width=\"100\" class=\"f7\" align=\"center\">$DepositID</td> <td width=\"150\" class=\"f7\" align=\"left\"><b>$Username</b></td> <td width=\"150\" class=\"f7\" align=\"left\">$DepositBank</td> <td width=\"150\" class=\"f7\" align=\"center\">$DepositAmount</td> <td width=\"150\" class=\"f7\" align=\"center\">$Channel</td> <td width=\"100\" class=\"f7\" align=\"center\">$Staff</td> <td width=\"200\" class=\"f7\" align=\"center\">$Date</td> </tr> </table> "; } ?>
<? $sql="select sum(ชื่อฟิวส์ ) as punch from (ชื่อตาราง) "; $result=mysql_query($sql); while($rs=mysql_fetch_array($result)){ echo $rs['punch']; } ?>
select * , (column1+column2) as sum_amount from table
Quote:select * , sum(column1) as total from table
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง