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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -