Hrm. Dunno then. I just manually tested it in MySQL and both approaches
worked. Are you able to test directly in MySQL? Might have to go to the
mysql list for this.
-Ed
> -Original Message-
>
> Yeah, I had tried that earlier but it doesn't work. It does generate
> a new value for t
Yeah, I had tried that earlier but it doesn't work. It does generate
a new value for temp each time but they are still in the same order as
the first one always has a lower temp value
On Thu, 7 Oct 2004 06:40:23 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote:
>
>
> select id, fname, lname, RAND
select id, fname, lname, RAND() as temp from clients where featured=1 order
by temp
> -Original Message-
> I have the following query:
>
> Select id, fname, lname from clients where featured=1 order by RAND()
>
> At any time, there should only be three clients where featured =1.
> Prob
I have the following query:
Select id, fname, lname from clients where featured=1 order by RAND()
At any time, there should only be three clients where featured =1.
Problem is I have run this query several times yet it always returns
them in the same order. Not sure it makes a difference but th
The MYI file is the index file. Is there an index on that table?
From: [EMAIL PROTECTED] (Jennifer Goodie)
To: blackwater dev <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED], Subject: Re: [PHP-DB] rand()
Date: Wed, 29 Sep 2004 23:27:43 +
-- Original message from blackwat
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 +, Jennifer Goodie <[EMAIL PROTECTED]> wrote:
> -- Original message from blackwater dev : --
> >
-- 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
Hello,
I have the following query:
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/#
PROTECTED]
Sent: Tuesday, June 24, 2003 6:19 PM
To: Doug Thompson
Cc: Becoming Digital; PHP-DB
Subject: Re: [PHP-DB] Rand() Emulation
Im probably not making myself clear.
Ultimately, my goal is to emulate mysql's ->
SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
for other databases tha
Becoming Digital wrote:
Ultimately, my goal is to emulate mysql's ->
SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
for other databases that do not support RAND().
Which are those?
Currently mySQL, PostgreSQL, and MSSQL.
To me the idea above would work, but it hinges on if that rand colum
On Wednesday 25 June 2003 00:19, Gerard Samuel wrote:
> Im probably not making myself clear.
> Ultimately, my goal is to emulate mysql's ->
> SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
>
> for other databases that do not support RAND(). So using variations of
> php's rand(), wouldn't make sense
ry/EGDXEBBWTYUU
- Original Message -
From: "Gerard Samuel" <[EMAIL PROTECTED]>
To: "Doug Thompson" <[EMAIL PROTECTED]>
Cc: "Becoming Digital" <[EMAIL PROTECTED]>; "PHP-DB"
<[EMAIL PROTECTED]>
Sent: Tuesday, 24 June, 2003 12
Yes its more than possible to do as you suggested, but as you implied,
not very friendly,
when it comes to large result sets...
Roedel, Mark wrote:
Might it be simpler, since you're assuming the presence of PHP anyway,
to just read your entire result set into an array and then shuffle() it
and t
l [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2003 11:19 AM
> To: Doug Thompson
> Cc: Becoming Digital; PHP-DB
> Subject: Re: [PHP-DB] Rand() Emulation
>
>
> Im probably not making myself clear.
> Ultimately, my goal is to emulate mysql's ->
> SELECT *
Im probably not making myself clear.
Ultimately, my goal is to emulate mysql's ->
SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
for other databases that do not support RAND(). So using variations of
php's rand(), wouldn't make sense,
as it only picks one value out of a range of values, that are n
An incredible interpretation of
If called without the optional min, max arguments rand() returns a pseudo-random value
between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for
example, use rand (5, 15).
Doug
On Tue, 24 Jun 2003 11:14:55 -0400, Gerard Samuel wro
Doesn't really cut it when you do not know a min and max value, or want
to extract a random range of numbers.
Becoming Digital wrote:
Im trying to figure out a way to emulate mysql's RAND() function to be
cross database compatible via php.
Has anyone done anything similar to this???
How abo
ingdigital.com
Did I help you? Want to show your thanks?
www.amazon.com/o/registry/EGDXEBBWTYUU
- Original Message -
From: "Gerard Samuel" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Tuesday, 24 June, 2003 02:56
Subject: [PHP-DB] Rand() E
Im trying to figure out a way to emulate mysql's RAND() function to be
cross database compatible via php.
Has anyone done anything similar to this???
Thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
19 matches
Mail list logo