For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > September 2004 > Re: [PHP-DB] rand()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] rand()
Jennifer Goodie

2004-09-29, 8:03 pm

-------------- Original message from blackwater dev : --------------
> select * from clients order by RAND()
>
> THe query runs fine on my local server but when I run it on my hosts
> server, it works ok if there is only one record in the db but then
> there is more than one...I get this error:
>
> #1 - Can't create/write to file '/var/tmp/#sqlbe_1d99_0.MYI' (Errcode: 2)
>
> What's going on?


perror 2 returns "Error code 2: No such file or directory"

Does /var/tmp exist on the server?

If you run explain on your query in both cases (with one record and with more than one record) you will see that when there is more than one record it is probably using temporary tables and file sort, but is not when there's only one record.
Blackwater Dev

2004-09-30, 2:55 am

I have no idea of it is on the server or now...I just have access to
my little section of the server. Is there another way to randomly
order?


On Wed, 29 Sep 2004 23:27:43 +0000, Jennifer Goodie <jgoodie@att.net> wrote:
> -------------- Original message from blackwater dev : --------------
>
> perror 2 returns "Error code 2: No such file or directory"
>
> Does /var/tmp exist on the server?
>
> If you run explain on your query in both cases (with one record and with more than one record) you will see that when there is more than one record it is probably using temporary tables and file sort, but is not when there's only one record.
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com