You are here:  » Search Random


Search Random

Submitted by amibrasil on Sun, 2006-07-02 21:42 in

Hi,

I am using an automatic translator forgives me any error.
I need to show in my site a random result for each time that a person visits .
I have a data base in excel with many results but I want to show only 3 or 4 random results for visitor.

Sample: Word "Cellular Phone"

Visitor 1 - See:
Cellular Phone Shoppings
Cellular Phone Acessories
Nokia Cellular Phones

Visitor 2 - See:

Sony Cellular Phone
Cellular Phone Reviews and News
Ringtones and Tons fo Cellular Phones
Antennas Cellular Phone

that is possible with magic to parser? Please help-me!

Thank You

Lucy

Submitted by support on Mon, 2006-07-03 09:55

Hello Lucy,

Whilst it should be possible to do this with Magic Parser, it would not be very efficient or very straight forward.

This is because to select random items, the parser would have to read every record in the file on every page view (just to know how many there are), and then read it again to select random items from the entire feed.

If you file is big, it would be too slow for a live website.

To do this, you really want to be looking at loading your file into a datbase (like MySQL) and then using a scripting language (like PHP) to select random items from the table.

Sorry I am not more help, but I hope this is usefull information.

Cheers,
David.