RE: [PHP] random generation
| From: | Matthew Leingang | Date: | Tue, 17 Oct 2000 13:05:52 +0000 |
| Subject: | RE: [PHP] random generation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20612@lists.php.net to get a copy of this message | ||
I like this idea, because then you can make that array of "remaining
questions" a session variable. Each time you load the page, you
array_shift() off a number from the array and display that problem. Now
the array has one less number in it. When are you done? When the array
is empty!
This might even be better than selecting 60 random records from the
database, because you said you only want to display them one at a time.
----------------------------------------------------------------
Matthew Leingang http://www.math.rutgers.edu/
Rutgers University leingang@math.rutgers.edu
Department of Mathematics "This signature needs no quote."
On Tue, 17 Oct 2000, Maxim Maletsky wrote:
> Rand() works only from MySQL vs. *23*
>
> you could create a code in PHP to do it, it generates a random array of
> numbers which you can then use as a pointer to get your results from the
> database.
>
> -----Original Message-----
> From: Kapil Bodhankar [mailto:kapil@archeanit.com]
> Sent: Tuesday, October 17, 2000 2:24 PM
> To: php-general@lists.php.net
> Subject: [PHP] random generation
>
>
> hi guys,
> i would like to get random questions displayed for my online
> examination.how do i get them displayed.i want to get 60 questions
> displayed randomly one after the other whenever i reload a page.
> infact i tried this:
> select * from questions order by Rand(); in Mysql,
> but this doesnot work. is there any other way to do it?
> --
> Kapil
> Web Developer
> kapil@archeanit.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> [ Part 104: "Included Message" ]
>