Re: [PHP] Unique ID on 5.0.4 (Windows)

2005-09-21 Thread Chris
Dragan Stanojevic - Nevidljivi wrote: Hi Chris, Chris wrote: Pretty soon I'm going to be needing to generate a unique identifier in a script. I'm looking into how to go about doing it now. It has to work on Apache 2 / PHP 5.0.4 (Module) / Windows 2000 Server. Any suggestions on how I might

Re: [PHP] Unique ID on 5.0.4 (Windows)

2005-09-21 Thread Dragan Stanojevic - Nevidljivi
Hi Chris, Chris wrote: Pretty soon I'm going to be needing to generate a unique identifier in a script. I'm looking into how to go about doing it now. It has to work on Apache 2 / PHP 5.0.4 (Module) / Windows 2000 Server. Any suggestions on how I might be able to do it? I'd appreciate any he

Re: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread J J
Wow I think you are on to something!!! I'll give it a whirl! Thanks! --- [EMAIL PROTECTED] wrote: > On 10 Mar 2004 J J wrote: > > > My problem is how do I recreate this in PHP to > make > > sure any newly added records follow this same > unique > > ID? > > I haven't played much with these fun

Re: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread trlists
On 10 Mar 2004 J J wrote: > My problem is how do I recreate this in PHP to make > sure any newly added records follow this same unique > ID? I haven't played much with these functions but I think for MySQL you'd want something like this, for the state "XX" (excuse the wrapped lines):

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread J J
Yeah thanks for the feedback, I'm already including a primary key auto_increment field in place to tie the tables together with an ID I *know* will be unique. This other ID scheme is just to work within their existing system that uses this. I'm just trying to mirror/maintain that scheme for their

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread Miles Thompson
At 04:10 PM 3/10/2004 -0800, Chris W. Parker wrote: J J 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 on

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread Chris W. Parker
J J on Wednesday, March 10, 2004 4:22 PM said: > Will it be able to figure out what the last number is > if it's a character type and the number is something > like 3? So it'll add one to make it 4 and not > something like 10003. php knows. you'll just have

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread J J
Will it be able to figure out what the last number is if it's a character type and the number is something like 3? So it'll add one to make it 4 and not something like 10003. ?? --- "Chris W. Parker" <[EMAIL PROTECTED]> wrote: > > yeah that makes sense. hmm.. well i'll give you my > ide

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread Chris W. Parker
J J 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 l

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread J J
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. Plus there should be allowed two of the same numbers, so like: AL3 KY3 So any state with more than one record can be sequential and not jump around like KY3, AL0

RE: [PHP] Unique ID system - need help/ideas

2004-03-10 Thread Chris W. Parker
J J on Wednesday, March 10, 2004 3:46 PM said: > Any ideas? Thank you in advance! does it all have to be in the same field? can you not just combine two fields? one field would be called 'id' and it would be auto-incrementing. second field would be 'state' and it w

Re: [PHP] Unique ID - again

2004-02-12 Thread Galen
MySQL (or another SQL database) is the answer. You can check for an existing OR use it's auto_increment or whatever else you like. Create a field to track all this stuff. There is no other way to guarantee that an ID is unique than to check it against existing. "Random" functions yield random r

Re: [PHP] Unique ID - again

2004-02-12 Thread Richard Davey
Hello Alex, Thursday, February 12, 2004, 11:00:41 AM, you wrote: A> I'm using usual md5(microtime()); to create IDs, but now I've encountered a A> problem with that. I need to create explicitly 6 digit unique A> number(decimal). Yes, I know I can use for/while loop to fill a string with A> digits

Re: [PHP] Unique ID

2003-11-12 Thread Marek Kilimajer
Javier Muniz wrote: Neither auto-increment nor sequences allow you to do what you're asking for though, which is like database garbage collection. If you really need something like this you should implement it in a cron job that runs during non-peak hours as it will be quite an expensive operation

Re: [PHP] Unique ID

2003-11-11 Thread John W. Holmes
Marek Kilimajer wrote: Dimitri Marshall wrote: I'm making a message board and I've decided the best way to go about the structure is to have 3 tables, two of them will be "Posts" and "Replys". Now, in order for this ti work, each post has to have a UniqueID - same with the replys. Looking at anoth

Re: [PHP] Unique ID

2003-11-11 Thread Boyan Nedkov
Dimitri Marshall wrote: Hi there, Here's my situation: I'm making a message board and I've decided the best way to go about the structure is to have 3 tables, two of them will be "Posts" and "Replys". Now, in order for this ti work, each post has to have a UniqueID - same with the replys. Looking a

RE: [PHP] Unique ID

2003-11-11 Thread Javier Muniz
ow to do this I'd love to hear it :) -Javier > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 11, 2003 3:30 PM > To: Dimitri Marshall > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Unique ID > > > Dimitri Marsh

Re: [PHP] Unique ID

2003-11-11 Thread Marek Kilimajer
Dimitri Marshall wrote: Hi there, Here's my situation: I'm making a message board and I've decided the best way to go about the structure is to have 3 tables, two of them will be "Posts" and "Replys". Now, in order for this ti work, each post has to have a UniqueID - same with the replys. Looking a

Re: [PHP] unique id

2003-07-28 Thread Curt Zirzow
* Thus wrote Gabriel Guzman ([EMAIL PROTECTED]): > On Sat, 2003-07-26 at 07:11, Curt Zirzow wrote: > > * Thus wrote jan ([EMAIL PROTECTED]): > > > Hi there! > > > > > > What's the best way to create uids (unique ids) even when runnig at > > > exactly same time (microseconds)? > > > > > > is this

Re: [PHP] unique id

2003-07-28 Thread Gabriel Guzman
On Sat, 2003-07-26 at 07:11, Curt Zirzow wrote: > * Thus wrote jan ([EMAIL PROTECTED]): > > Hi there! > > > > What's the best way to create uids (unique ids) even when runnig at > > exactly same time (microseconds)? > > > > is this enough ??? > > > > $r = mt_rand(); > > $uid = uniqid(getmypid()

Re: [PHP] unique id

2003-07-26 Thread Curt Zirzow
* Thus wrote jan ([EMAIL PROTECTED]): > Hi there! > > What's the best way to create uids (unique ids) even when runnig at > exactly same time (microseconds)? > > is this enough ??? > > $r = mt_rand(); > $uid = uniqid(getmypid() . $r); If you're running a cluster of machines I would include info

Re: [PHP] unique id

2003-07-26 Thread Tom Rogers
Hi, Saturday, July 26, 2003, 5:58:41 PM, you wrote: j> Hi there! j> What's the best way to create uids (unique ids) even when runnig at j> exactly same time (microseconds)? j> is this enough ??? j> $r = mt_rand(); j> $uid = uniqid(getmypid() . $r); j> thanks j> Jan I use: $id = md5(uniqid(

Re: [PHP] unique id

2002-10-29 Thread 1LT John W. Holmes
> How do I generate a uniqueid in php? www.php.net/uniqid ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unique ID

2002-04-11 Thread Steve Bissonnette
I personally really like this, Maybe you can customize it as needed - or someone can improve upon it ! PIN9f39f7 $rawuid = md5(uniqid(rand(),1)); $uid = "PIN" . substr($rawuid,0,6); echo $uid; ?> on 4/11/02 3:44 PM, ROBERT MCPEAK at [EMAIL PROTECTED] wrote: > Could somebody

Re: [PHP] unique id

2001-01-10 Thread Richard Lynch
*WHY* not use auto_increment? Would the builtin http://php.net/uniqid function not work better? *NEVER* seed the random number generator more than once per script. Call srand() once, and only once. The return() statement will return the MySQL resource ID, which is probably not useful, but all