Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

50 users online



Pull random data from DB

Pull random data from DB

Currently viewing this thread: 1 (0 members and 1 guests)


droomagon

droomagon

Neverside Newbie
Status: Offline!

Pull random data from DB

As the title suggest, I'm working on a website that would extract then post random data from the DB (let's just say 10 data entry out of 2000 entries for now) on the front page.

I thought of using 10 random number and then extract those 10 entries from the DB, but then I thought that would be too much work if I decide to change from 10 entries to 20 later on.... is there a better idea?

mcdude

mcdude

Blah
Status: Offline!

I think a random number is the best way forward, seems the most logical as well.

schoi

schoi

funny and cheeky
Status: Offline!

droomagon why do u say it's too much work? It's a basic script. All u need is a for loop and rand function function built into php. http://uk.php.net/manual/en/function.rand.php. U pass the number to mysql results function. Have a look at the mysql functions. Most of the tutorials i've seen use mysql result but there others.

Last edited by schoi, January 19th, 2007 09:54 PM (Edited 1 times)

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0156 seconds.