Author Topic: Handling Random product results  (Read 2013 times)


  • Beginner
  • *
  • Posts: 11
Handling Random product results
« on: November 30, 2011, 23:00:13 pm »
Hello world!  ;D

Is it possible to generate a random-product-result through Top Menu?

Currently, it is being sorted by product name. (ORDER BY statement).
Each time I navigate through page results it makes the same query but a limit statement is used. (So same query but it takes different elements...)
First from 0 to 16.
Second from 17 to 32.
And so on...

There is a RANDOM() function in MySQL queries and it works perfect.

The problem is that when you navigate to the next page you may get already-seen product (because it is random).  :-\

Is there any way to keep shown-product IDs in a static-global-php array variable?  :o

As far as I can see it, it maybe a problem if you want to navigate backwards.
I guess it should remember/store the previous result.


Quality is remembered long after effort is forgotten.