Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Gerard Samuel
On Wednesday 29 October 2003 02:24 pm, Payne wrote:
 Hi,

 I have been working on a simple PHP script that called to a mysql
 database, where I  do the following

 SELECT url FROM sponsors ORDER BY RAND();

Try -
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Gerard Samuel wrote:

On Wednesday 29 October 2003 02:24 pm, Payne wrote:
 

Hi,

I have been working on a simple PHP script that called to a mysql
database, where I  do the following
SELECT url FROM sponsors ORDER BY RAND();
   

Try -
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;
 

I did that same thing.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] ORDER BY RAND()....

2003-10-29 Thread Chris W. Parker
Payne mailto:[EMAIL PROTECTED]
on Wednesday, October 29, 2003 11:54 AM said:

 Try -
 SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;
 
 
 
 I did that same thing.

SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1;

How about that one?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ORDER BY RAND()....

2003-10-29 Thread Payne
Ok, this gives me an error. I guess what I was asking early is there 
away to print an echo without doing myrow? Why can I do echo $result 
without getting Resource id # My thinking is if you look at my first 
e-mail, my code is trying to fetch multi-rows from the database, I don't 
need multi row,  I thinking becaue fetch calls the database multi time 
that it defects the rand() function.

Payne

Chris W. Parker wrote:

Payne mailto:[EMAIL PROTECTED]
   on Wednesday, October 29, 2003 11:54 AM said:
 

Try -
SELECT url FROM sponsors ORDER BY RAND() LIMIT 1;


 

I did that same thing.
   

SELECT url FROM sponsors ORDER BY column RAND() LIMIT 1;

How about that one?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php