RE: [PHP] retrieving random data from mysql database

2002-07-15 Thread David Freeman
> When you say, > Order by RAND() > I would think the "Order by" construct expects a column name. > In your case, it gets a decimal value. > How does "Order by" treat decimal values? > Oh, I just checked the manual: > In MySQL Version 3.23, you can, however, do: SELECT * FROM > table_n

RE: [PHP] retrieving random data from mysql database

2002-07-14 Thread Anas Mughal
When you say, Order by RAND() I would think the "Order by" construct expects a column name. In your case, it gets a decimal value. How does "Order by" treat decimal values? Oh, I just checked the manual: In MySQL Version 3.23, you can, however, do: SELECT * FROM table_name ORDER BY RAND() I st

Re: [PHP] retrieving random data from mysql database

2002-07-14 Thread Chris Knipe
SELECT RANDOM name FROM table or SELECT name FROM table ORDER BY RANDOM LIMIT 1 not tested, used at your own free will. -- me - Original Message - From: "mm fernandez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 14, 2002 11:37 PM Subject: [PHP] retrieving random da

RE: [PHP] retrieving random data from mysql database

2002-07-14 Thread David Freeman
> can you teach me how to retrieve random data from my > database? like for example...i have a list of names on my > database and i'd like to retrieve only one name at a > time..randomly. how do i go about this? This is really a database question rather than a php question and you haven't