J J <mailto:[EMAIL PROTECTED]>
    on Wednesday, March 10, 2004 4:03 PM said:

> I'd like to keep it in one field if possible since
> that's how their database is now and data will be
> going back and forth.

[snip]

> So any state with more than one record can be
> sequential and not jump around like KY00003, AL00004,
> KY00005, etc.
> 
> Make sense?

yeah that makes sense. hmm.. well i'll give you my idea.. but it's very
possible there's a better way to do it (than what i'm going to suggest).

ok. one field will be used. it'll be a text (varchar) field. before you
do an insert you'll need to find out what's in there ahead of time and
then adjust accordingly. i'd select the last record that contained the
two letter abbreviation, find out what the number was, increment it,
then reconstruct the id and insert the new one.

this of course won't prevent the exact same process from happening at
the exact same time. i mean, two sessions could pull the same id and
then reconstruct the (new, but) same id.

make sense?


chris.

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

Reply via email to