An auto-incrementing primary key will never give the same value to two users if you use it correctly. This is because the primary key, by definition, includes a unique constraint.
To use it correctly, first insert a row, and then enter the identifier of the last inserted row. There's a whole page about this in the MySQL documentation, for example. In MySQL, you can use LAST_INSERT_ID()or mysql_insert_id()to get the identifier of the last row inserted.
The bad method is to insert the row first and then query the table for MAX(id).
, . , , .