Hi,
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've noticed the uuid PECL package,
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
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
I was given a database that has uniques IDs such as:
AL1
AL2
AR1
AR2
MI1
etc...
The first two letters are based on the state they live
in, then it would need to look at the next 5
characters to determine the next ID.
My problem is how do I recreate this in PHP to make
sure
J J mailto:[EMAIL PROTECTED]
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
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,
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
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
idea..
J J mailto:[EMAIL PROTECTED]
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 to
At 04:10 PM 3/10/2004 -0800, Chris W. Parker wrote:
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
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
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):
if
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 functions but
Hi folks,
I'm using usual md5(microtime()); to create IDs, but now I've encountered a
problem with that. I need to create explicitly 6 digit unique
number(decimal). Yes, I know I can use for/while loop to fill a string with
digits, but is it ABSOLUTELY sure that the random will never return same
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,
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
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
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 at another program, I can
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 at
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 Marshall wrote:
Hi there,
Here's my situation:
I'm making a message
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 at
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 another
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() . $r);
If
* 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 enough ???
$r
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);
thanks
Jan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
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 =
* 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 information
How do I generate a uniqueid in php?
Thanks,
Eddie
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
just use auto_increment.
- Original Message -
From: AJDIN BRANDIC [EMAIL PROTECTED]
Newsgroups: php.general
Sent: Tuesday, January 09, 2001 11:14 AM
Subject: [PHP] unique id
Hi again,
I am generating a randum number but before inserting it into a table I
want to make sure that onother
30 matches
Mail list logo