>Do I need to be reading up on locking tables/rows? Or in my situation  
>as I've briefly described it do I not have to worry about it? Or is  
>there a third door with the magic bullet that will solve all my  
>problems? :)
>Any advice is greatly appreciated as always, RTFMing is good as well,  
>as long as M is defined :)

When using mysql along with PHPs mysql_insert_id() 
(http://de.php.net/manual/en/function.mysql-insert-id.php), the docs say:
    Because mysql_insert_id() acts on the last performed
    query, be sure to call mysql_insert_id() immediately 
    after the query that generates the value.

So yes, from my point of view (which is in that case very paranoid), I'd say 
race conditions are possible to happen. One solution would be to save the user 
id along with the saved record, then fetch the last inserted record by this 
user and return the id for this record. A timestamp (microtime()) might also 

On the other hand - yes, there is still the possbility of locking the table.



Thorsten Suckow-Homberg
Jakobstrasse 214-216
52064 Aachen

Tel.:  0151 -10927135
Email: t...@siteartwork.de

You should follow me on Twitter: http://twitter.com/ThorstenSuckow

Sent with conjoon. Visit http://www.conjoon.org

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to