PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 3rd, 2004, 12:24 PM
brononi brononi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 brononi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 5 sec
Reputation Power: 0
generate ID

Hey,

I've change a existing tool a little bit.
There is a section that creates/saves an ID to db. Before this was coded in MD5(?). I don't want this.
But can't figured it out.

Can i change following piece so he creates a unique 'simple' number?

function generate_id()
{
global $title, $description;
$continue = true;
//$auction_id = uniqid("");

$auction_id = uniqid(rand());
//$auction_id = eregi_replace("[a-f]","",$auction_id);


return $auction_id;
}

Thanks a lot,
Brononi

Reply With Quote
  #2  
Old June 3rd, 2004, 01:43 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Can't tell you much if you don't also provide the uniquid function. Why not just use something like the following:

PHP Code:
function generate_id(){
    return 
time() . microtime();



It's not guaranteed to give you a unique id, but it's at least as likely to as what you've already got, and it returns a big integer that's not hashed.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > generate ID


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT