php-windows | 2001042
Date: 04/30/01
- Next message: jtjohnston: "[PHP-WIN] microweb.exe"
- Previous message: r.gelstharp: "[PHP-WIN] need help displaying random records"
- In reply to: r.gelstharp: "[PHP-WIN] need help displaying random records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 30 Apr 2001 17:27:44 -0700, r.gelstharp <r.gelstharp <email protected>> wrote:
> As a university degree student my final year project is a comparison on ASP
> v PHP. I have to make two identical sites in both languages, but am at the
> moment having trouble duplicating a function on my ASP pages in PHP.
>
> The default page in my ASP pages display random records from the database to
> the screen, but I'm having a bugger of a time trying to duplicate the effort
> in PHP.
Which database are you using? If you don't have an easy database (e.g. records
from 1 to 100 allowing a simple select where ID=rand()), you'll probably need
something database specific - for example, in SQL Server you should be able to
do SELECT TOP 1 ... ORDER BY RAND().
Alternately, if you only have a small number of records, you could simply
select all of the records and then pick a row from the resultset at random.
Chris
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe <email protected> For additional commands, e-mail: php-windows-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: jtjohnston: "[PHP-WIN] microweb.exe"
- Previous message: r.gelstharp: "[PHP-WIN] need help displaying random records"
- In reply to: r.gelstharp: "[PHP-WIN] need help displaying random records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

