mercredi 6 juillet 2016

increse numbers from 00000


I want to increase numbers from 00000 to 99999. I tried, but its not working. Below is my code. I am trying from 10 hrs. but result is same. Please help. $result=mysql_query("select rid from regid") or die (mysql_error("No Record Found")); while($row=mysql_fetch_array($result)) { extract($row); $sub=substr("$rid",15); //It is substring 00000 coming from database. $n2 = str_pad($sub + 1, 5, 0, STR_PAD_LEFT); // It is code line. echo $n2; }

Aucun commentaire:

Enregistrer un commentaire