PHP Indonesia - Facebook | PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ | |
|
[ask] sya ad field tabel dimana field itu berisi ... Oct 7th 2013, 06:14, by Adhie Purwa Sasmita | [ask]
sya ad field tabel dimana field itu berisi nilai angka, misalkan : A. 20 B. 30 C. 40 D. 10
nah sya mau buat persentase dari setiap field tersebut, yang berarti pertama mentotalkan semua nilai'a lalu menghitung persentasenya
$total=0; while($record=mysql_fetch_array($sql)){ $total=$total+$record['vote']; $percent=($record['vote']/$total)*100; }
yg sya bingung gmn cara mentotal dan mencari persentase'a disaat yg bersamaan?? | | |
|
Tidak ada komentar:
Posting Komentar