如何在php,mysql数据库中保存数字为0001或0006?

i am fetching database value of a column as 0005 , then i am adding 1 to it and save it in the database with a char ABHI but in the database its saved as ABHI6 not ABHI0006. how to do it??

here is the php script

$name = mysqli_real_escape_string($conn, $_POST['name']);
$id = mysqli_real_escape_string($conn, $_POST['id_last']);
$id2=+$id;
$sql="INSERT INTO file (name, unique_id )
VALUES ('$name','$name$id2')"; 

Use padding for the string

$name = mysqli_real_escape_string($conn, $_POST['name']);
$id = mysqli_real_escape_string($conn, $_POST['id_last']);
$id2 = "$name".str_pad(++$id, 4, "0", STR_PAD_LEFT);
$sql="INSERT INTO file (name, unique_id )
VALUES ('$name','$id2')"; 

See refrence here

Try with this

$id = "ABHI1";
$IncrementID =  substr($id, -1) +1;
echo substr_replace($id,$IncrementID,-1);

Out put

ABHI2