I want to insert into DB 000001 and 000002 and .... but inserting 1 and 2..
any body help me to solve this problem

my code is

$b = mysql_query("SELECT MAX(app_number) FROM  tb2_payment ")or die(mysql_error());


while($row_b = mysql_fetch_array($b)){

        $app_number=$row_b['MAX(app_number)'];

        if($app_number=="")
        {
        $app_number2=000001;
        }
        else
        {
        $app_number2=$app_number+1;
        }
}
echo $app_number2;

Thanks for giving valuable information.

but without padding i want insert:
I am taking formid from DB maximum value is 000001.
Next time submit click means it will take max value from DB and increment automatically to 000002 and 000003

any body help me to solve this problem

Thanx Lau,

Its working,

All Information is available.

Very Thanx for giving information

If problem resolve, please mark this thread as solved, thanks

k Lau, Thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.