reserve some ids for the particular rows in php mysql -


is possible reserve ids upto rows. let have add stores using 3 api,om,vcomm,icube when add 3 stores randomly using php,it go second database as

---------------------------- id | apiname |  ----------------------------- 1-500 | icube |  501-1000 | om  1001 - 2000 | vcomm ----------------------------------------- 

as in above database when clicked on store of icube api placed within id of 1 500,when click on store of om placed within id of 500-1000 , when click on vcommm placed 1001-2000,not 1 one. can please me?

this should work

insert tablename (id,apiname)  values ((select max(id)+1 tablename t t.apiname='icube'),'icube'); 

or

insert tablename (id,apiname) values ((select max(id)+1 tablename t t.apiname='om'),'om'); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -