mysql - Queuing SQL requests PHP -
is possible queue client requests accessing database in mysql. trying concurrency management. mysql locks can used somehow not able desired outcome.
effectively trying is:
- insert in new row
- select column row
- store value in variable
the issue comes when 2 different clients insert @ same time, variables both clients store value of last insert.
i worked following alternative, failed in few test runs, , bug quite evident:
- insert
- lock table
- select
- store
- unlock
thanks!
my best guess have auto-increment column , want value after inserting row. 1 option use last_insert_id() (details here , here).
if not applicable, please post more details. trying , queries being fired?
Comments
Post a Comment