On Friday 16 August 2002 17:37, Christian Ista wrote:
> Hello,
>
> In an MySQL table, I insert some records. Before each insert (just
> before),
> I do a "Select max() ..." and I increment the result by one, to give a
> number (unique), and I have an auto_incremente field too.

Not sure why you would have a field that is manually incremented and also one 
that is auto_incremented.

> I'd like to know if there is a mechanism in PHP, if several person do
> the same thing in the same moment, to not have several record with the
> same number.

PHP does not have such a mechanism. You can lock the relevant table, then 
query, then increment and update value, then unlock table. For further info

1) ask on php-db list
2) ask on mysql list


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
What ever happened to happily ever after?
*/


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

Reply via email to