I have a table that stores "records" and already has primary key.
Table A
=======
id (INT) PK auto_increments
project_id (INT)
record_text (TEXT)
This table stores "records" for all of my projects. It is desirable to have a secondary key that auto increments for the projects.
Example: If project 1 had id's of (1,5,8,9). It would be desirable to store them and present them to the user as (1,2,3,4).
I do not have the ability to use TRANSACTIONS and I'm having trouble thinking of a way of doing this without causing concurrency issues.
Hopefully I got my problem across clearly. Thank you in advance for the help.
Edit (Example):
Assuming the structure:
id, project_id, record text
1 1 testing
2 1 testing
3 2 testing
4 1 testing
My ID's for project 1 would 1,2,4. But I'm looking for a way to store and display them for project 1 as 1,2,3