PHP - Random number selector

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
Watch

SiKing

Registered MemberEstablished Member
Impact
6
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
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
0
Close
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.
 
0
Close
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?
 
0
Close
The number is just an id
 
0
Close
Can you clarify what you are looking for so I can help?
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back