Re: Create unique non-autoincrement key for 700,000 records?
| From: | Ondrej Kulaty | Date: | Tue, 16 Dec 2008 06:35:03 +0000 |
| Subject: | Re: Create unique non-autoincrement key for 700,000 records? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284651@lists.php.net to get a copy of this message | ||
I use md5(microtime());
--
Ondrej Kulaty
"Rob Gould" <gouldimg@mac.com> píse v diskusním príspevku
news:1492934866135048840337272044147195196-Webmail@me.com...
>I have a mySQL database with 700,000 records in it, which are presently
>keyed with an "auto-increment" field.
>
> What I'd like to do is create another field with a field where each and
> every record number has a unique keyvalue. Example: "su5e23vlskd" for
> records 1, and "34fdfdsglkdj4" for record 2. All that matters is that
> it's unique, and isn't a number that can be guessed or an "autoincrement"
> number, where a hacker can just figure out the keyvalue by incrementing
> numbers. It doesn't matter to me if each keyvalue field is just numbers,
> or a number/letter combination - - - all that matters is that each
> keyvalue field is unique. Is there an automatic way that mySQL could do
> that, or would I need to write a php script to somehow go through each
> record and create this unique value?
>
>