Hi everybody,
I'm new to MySQL and I'm trying to figure out a way of
automatically generating a sequence of unique id numbers
in many tables. I need to get new id's at any time
and possibly from different connections. As I understand,
AUTO_INCREMENT does this, but the sequence it generates
is not global. That is, if table T1 and T2 have AUTO_INCREMENT
id columns, then a row in T1 could have the same id as
a row in T2. I think I could circumvent this by setting
the AUTO_INCREMENT sequence so that it starts at say 1000000
in T1, 2000000 in T2, 3000000 in T3 and so on. The chances
that rows in different tables have the same id would be
rather slim. But I don't really like this solution. Does anybody
knows a cleaner and nicer way of doing this ?
Thanks in advance.
J-P
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php