|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
Can't tell you much if you don't also provide the uniquid function. Why not just use something like the following:
PHP Code:
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > generate ID |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|