NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP - Random number selector

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 12-18-2005, 03:11 AM THREAD STARTER               #1 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




PHP - Random number selector


Ello. I am offering 50 NP$ to anyone who can give me a PHP/MySQL script which will:

- Select the data from a MySQL database
- Take the numbers from the 'x' row
- and then display a random name from the table according to probability of the 'x'.

Sorry, I know that isn't too clear. Basically, there is a table with rows 'x' and 'name'. If one entry (Jim) in the database has '50' in the 'x' row , and another (Paul) has '1'. The script is 50 times more likely to display 'Jim's' results.

Sorry, I know that isn't too clear. very tired
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 12-18-2005, 06:25 AM   #2 (permalink)
mch
NamePros Regular
Join Date: Nov 2005
Location: EU
Posts: 248
mch is on a distinguished road
 



I can't give you the script but I found an MSSQL script that might help.
http://www.sqlteam.com/item.asp?ItemID=802
mch is offline  
Old 12-18-2005, 07:56 AM THREAD STARTER               #3 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




Thanks. However, I was looking for a MYSQL script rather than MSSQL.

I am developing something myself instead, and I just need to know how I can find all of the 'id's in a table. (For example, if I delete a row). I could use mysql_numrows, but it may include id's which do not exist. For example, it will select id's 1-50, but I may have deleted row #40.
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 12-18-2005, 08:41 AM   #4 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



Quote:
The script is 50 times more likely to display 'Jim's' results.
does that mean that ur table is a frequency table? or is the number just an id?
nasaboy007 is offline  
Old 12-18-2005, 11:14 AM THREAD STARTER               #5 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 573
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




The number is just an id
__________________
Encenta - Amazon Associates CMS
Encenta.com is offline  
Old 12-18-2005, 05:44 PM   #6 (permalink)
jdk
Senior Member
 
jdk's Avatar
Join Date: Jul 2004
Location: Florida
Posts: 1,492
jdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond reputejdk has a reputation beyond repute
 



Can you clarify what you are looking for so I can help?
__________________
All offers are valid for 12 hours unless otherwise stated.
jdk is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 02:39 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 10:09 AM
appraise please Complete Hostings Domain Appraisals 2 01-19-2005 04:03 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:41 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger