Re: Random Selecting from mySQL

From: Date: Wed, 13 Mar 2002 19:13:36 +0000
Subject: Re: Random Selecting from mySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88387@lists.php.net to get a copy of this message
You could store the results in a session var to carry along the pages. Then on the second just retrieve them. Or maybe a second table with this info. Give each search an ID and store the results there. It would be easy to implement: INSERT INTO table ('',field) SELECT field FROM table ORDER BY rand() The first '' is for the autoincrement that will be used as your search id. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "Georgie Casey" <webmaster@filmfind.tv> wrote in message news:20020313190033.84454.qmail@pb1.pair.com... > I know how to use the "ORDER BY rand()" command on the end of queries to > randomize selection, but that's no good when you want to only display 10 > results per page. The next page the user chooses, randomizes again and could > show duplicate fields and not at all show other fields. > > Does anyone know a way round this? > > -- > Regards, > Georgie Casey > webmaster@filmfind.tv > > *************************** > http://www.filmfind.tv > Ireland's Online Film Production Directory > *************************** > >

« previous php.general (#88387) next »