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/ | |
|
sore agan agan, mau nanya nih saya mau bikin incr... Oct 21st 2013, 10:51, by Fariz Yoga Syahputra | sore agan agan, mau nanya nih
saya mau bikin increment kaya gini 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 dst
itu gmn ya gan logikanya ?
thanks agan agan |
| | up dong |
| | Angka 0 di depan tujuannya buat apa gan? Coba liat dl kegunaannya... |
| | begini bisa....
<?php
for($i=1;$i<10000;$i++){ if(strlen($i) ==1){ echo "000".$i."<br />"; } else if(strlen($i) ==2){ echo "00".$i."<br />"; } else if (strlen($i) ==3){ echo "0".$i."<br />"; } else{ echo $i."<br />"; }
} ?> |
| | buat NIM gitu mas |
| | mysql int(4) primary key, autoincrement, unsigned zero fill :D |
| | autoincrement di sql kan formatnya ga bgitu om, cum 1,2,3,4,5,6 dst |
| | wah thaks agan makasih | | |
|
Tidak ada komentar:
Posting Komentar