TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 12-17-2008, 02:51 PM   #1 (permalink)
The Contributor
 
Join Date: Sep 2008
Posts: 39
Thanks: 9
code_junkie is on a distinguished road
Help Unique random number?

I have a site for my company that requires a report number. This report number is the id for a specific report, so must be unique. At first I assumed that just a randomly generated number would work, but didn't think the site would get as many reports as it is. So now I need to set it so the random number is unique. How can I do this? My first thought is to query the db to see if the number exist then somehow get a new number if it does exist, but that seems like the wrong way to me. Can someone help me?
__________________
Trying to learn all I can about PHP. Teach me what you know...
code_junkie is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing random links with an array paulOr Advanced PHP Programming 6 10-24-2008 09:28 AM
What do you use for random integers? Enfernikus Absolute Beginners 6 06-09-2008 08:46 PM
how to get the rows affected(not number of rows) kororo203 Absolute Beginners 2 04-23-2008 08:32 AM
Version Checker khile Advanced PHP Programming 21 03-04-2008 10:08 PM
How Rdoanm is Rondam? Wildhoney General 3 09-19-2007 01:32 PM


All times are GMT. The time now is 11:35 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design