[eluser]Daniel Moore[/eluser]
[quote author="mTuran" date="1245573632"]I have 2 table for my users. One of "experts" another of "employer", each table have unique ids. in this point i want to give unique id experts and employers same time. For example if last created expert id is 5 then next created employer will be 6 that is which i want. I am waitting your solutions thanks.[/quote]
Ok, if you really want to do it in this manner, there is actually a very simple solution to your problem here.
1. Create a 3rd table, call it "unique_id".
2. Have one field in this table, and have that field be autoincrement.
3. When you create either a new "employer" or "expert", first add an entry to the "unique_id" table, read the last entry, and use that as your "unique_id" for the "employer" or "expert".
It's not that complicated. Really.
Alternatively, if you don't want 50,000 entries or more eventually in your "unique_id" table, then only keep one entry in the table, that of the last used ID. Have your program increment it, and save it back to the table, and use it for your "employer" or "expert".
It's really no different from a site counter, if you think about it, and is just as easy to implement.