Hi,
My opinion:
You can't use auto_increment in this way.For sure you must do some functions
in php to check flexibility conditions of the digits which are using for new
ID of entire row.The ID field from your table must be CHAR().

E.g:
You need 3 variables;

set @a:="";            --initialize variable a;
set @b:="";            --initialize variable b;
set @c:="";            --initialize variable c;
select @a:=some_peculiar_for_gen_the_id from your_table where
your_conditions;
select @b:=other_peculiar_for_gen_the_id from your_table where
your_conditions;
select @c:=other_peculiar_for_gen_the_id from your_table where
your_conditions;

insert into table_for_insert_data SET ID_FIELD=CONCAT(@a,@b,@c) and
...others data;

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- 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

Reply via email to