| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Senior Member | MYSQL question showing random row from database MYSQL question showing random row from database i am trying to mess around with tags on my site i would like to show random row content from the available rows in my mysql table i want to run something like the cloud of tags how can i do this ? Regards |
| |
| | #4 (permalink) | |
| NamePros Regular | Quote:
| |
| |
| | #6 (permalink) | |
| NamePros Regular | Quote:
I would do it like this... * A table containing keywords (A) * A table containing a list of pages (B) * A table relating (A,B) with unique constraint (A,B) and frequency of occurrence. To load the "related" links, do a keyword inventory on the page and take as many keywords as you need to fill 30 spots, and match up highest occurrence in page with occurrence in the relation table above. Sorry if all that sounded vague, I'm kinda creating the idea in my head as I type, LOL. | |
| |
| | #8 (permalink) |
| i love automation | Hi, Ryan. Usually, i push available row IDs to an array. And choose random IDs from the array (which means 30 IDs in your example). Next, i take the data. Here's the code PHP Code: Kurniawan.
__________________ Xrvel | Various online tools | Free Proxy List | Hidden Proxy Partai Golkar | Noomle works : Las Vegas Airfare Last edited by xrvel; 03-04-2008 at 01:48 AM. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |