| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | 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 |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Nov 2005 Location: EU
Posts: 248
![]() | I can't give you the script but I found an MSSQL script that might help. http://www.sqlteam.com/item.asp?ItemID=802 |
| |
| | THREAD STARTER #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | 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 |
| |
| | #4 (permalink) | ||||
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! | ||||
| |
| | THREAD STARTER #5 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 573
![]() ![]() | The number is just an id
__________________ Encenta - Amazon Associates CMS |
| |
![]() |
| 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 |