IMHO you can INCREMENT only numbers . :) . Why only three numbers ? Anyway i'd see a solution like this :
table : id field [1..n] Select (@max_number:=max(id)) from table; Insert into table(id,field1,fieldn) values (@max+0.1,'xxx','xxx'); that's kindof solution . ----- Original Message ----- From: "Erick Papadakis" <[EMAIL PROTECTED]> To: "mysql" <[EMAIL PROTECTED]> Sent: Monday, July 08, 2002 2:30 PM Subject: mysql primary key question! > hello, > > i hope some database guru can help me with this! > > i need to set up an auto_increment field inside mysql. for various > reasons, the maximum size is 3. but i don't want this to be ONLY integers > because that limits me until 999 numbers only. since i have all > flexibility for these three digits or letters, i want to include numbers > and some characters into it as well. e.g., > > m78 > 23a > 1pt > 1~8 > !76 > > ...etc can all be valid keys for me. > > how can i generate such numbers on the fly? if not inside mysql, then > inside php? AND...be sure that the "key" so generated has not been used > before as an id field in my data? > > any ideas would be very welcome! > > thanks very much in advance/erick > > > > __________________________________________________ > Do You Yahoo!? > Sign up for SBC Yahoo! Dial - First Month Free > http://sbc.yahoo.com > > --------------------------------------------------------------------- > 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 --------------------------------------------------------------------- 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