for($i=1;$i<=100;$i++) { mysql_query("INSERT INTO jos_sorular (count) VALUES ('count.$i') "); } ?> PHP: This is count1 count2 count3 .......... count100 but i want it as this; count001 count002 ............ count099 count100 ............. so how can i do this automatically?
<?php for($i=1;$i<=100;$i++) { if($i < 10){ $i = "00".$i; } else if($i < 100){ $i = "0".$i; } mysql_query("INSERT INTO jos_sorular (count) VALUES ('count.$i') "); } ?> PHP:
for($i=1;$i<=100;$i++) { if( strlen($i)==1 ) { $say='00'.$i; } elseif( strlen($i)==2 ) { $say='0'.$i; } elseif( strlen($i)==3 ) { $say=$i; } mysql_query("INSERT INTO jos_sorular (count) VALUES ('$count$say')"); } ?>