Re: [PHP-DB] Pick a row, any row.
the syntax "order by rand()" is new in version 3.23 -- Regards, Gary "SuperID" Huntress === FreeSQL.org offering free database hosting to developers Visit http://www.freesql.org ""Johannes Janson"" <[EMAIL PROTECTED]> wrote in message 9e11f0$eog$[EMAIL PROTECTED]">news:9e11f0$eog$[EMAIL PROTECTED]... > Hi, > > > How can I pick a random row? > > SELECT * FROM table ORDER BY RAND() LIMIT 0, 1; > I'm not really sure but it worked with order by rand. Check > the manual on that if it doesn't work > > hope it helps > Johannes > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Pick a row, any row.
Hi, > How can I pick a random row? SELECT * FROM table ORDER BY RAND() LIMIT 0, 1; I'm not really sure but it worked with order by rand. Check the manual on that if it doesn't work hope it helps Johannes -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DB] Pick a row, any row.
Newbie alert! Hi. Just a qucik question: Does anyone know of a random function that I can use. I want to query my database. Then random pick one of the rows in the result, and then display the contents of the randomly picked row. How can I pick a random row? Thank you in advance. -- == Regards from Denmark, Europe Please cc your reply to [EMAIL PROTECTED] == I haven't lost my mind, I've got it backed up on TAPE somewhere... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]