|
Because in theory there may be a great many results
you shouldn't be reading them all into an array anyway,
and using theose two different subs is a little silly.
Instead I'd suggest a fetchrow_array or fetchrow_hash loop,
displaying each entry as it's found.
I'd also do it with one SELECT statement.
The exact syntax of that statement depends on how "yours"
versus "not yours" is represented in the database.
Let's assume you have a column called "ownerID" and
that your ownerID is 56. So anything with a 56 in the ownerID
column is yours. Then you'd do:
SELECT ... FROM ... ORDER BY ownerID=56 DESC
to randomly order, while making sure yours are on top:
SELECT ... FROM ... ORDER BY ownerID=56 DESC, RAND()
__________________
For historical display only. This information is not current:
support@bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
|