in reply to Queues, not the usual problem
To handle row locking you could add a status field, and then
do your insert, anything else you need to do, then do an
UPDATE table SET status = 1 WHERE row = LAST_INSERT_ID();
and then change the select to check for status = 1...
but I think as long as your insert is only a single simple insert
that it is not a problem...
Update bad suaveant, didn't read the post right...
use the row id from autoincrement to key into your second table, and then do the
update to set the status = 1 in the main table... that should
do you good. So do main insert, then
SELECT LAST_INSERT_ID() FROM table1;
and use that key to populate table2 with the proper key,
then
UPDATE table SET status = 1 WHERE key = $key;
Should work great
- Ant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Queues, not the usual problem
by arhuman (Vicar) on Jul 09, 2001 at 17:33 UTC |