php - Auto increment with my own number with alphabet -


i want auto increment id @ mysql id. , id saved in mysql. sorry poor english; maybe of not understand im talking about. let me show example.

like this:

abc/def/001(001)until abc/def/001(100)

the auto increment id auto change to

abc/def/002(001).

is possible it?

can me?

thanks lot.

(i update question)

can possible write php code or generator php code , save mysql?

you use 2 columns achieve that. 1 of them normal auto increment integer value, second one, updated whenever new row inserted either trigger or manually using concat():

$query = "insert table1 (column1,colum2,column3) values (1,2,3)"; mysqli_query($link,$query); $last_insert_id = mysqli_insert_id($link); $query = "update table1 set my_auto_increment = concat('abc/def/', id) id = '$last_inserted_id'" // id integer auto increment field mysqli_query($link,$query); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -