#22597 [NEW]: PHP can't select random rows from MySql
| From: | grugli at mmedia dot is | Date: | Sat, 08 Mar 2003 00:42:13 +0000 |
| Subject: | #22597 [NEW]: PHP can't select random rows from MySql | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-35087@lists.php.net to get a copy of this message | ||
From: grugli at mmedia dot is
Operating system: Windows XP
PHP version: 4.3.1
PHP Bug Type: MySQL related
Bug description: PHP can't select random rows from MySql
This MySql-query doesn't seem to work.
$Query = "select * from $TableName ORDER BY RAND() LIMIT 1";
The only thing that the query returns is the first row and nothing else.
ORDER BY RAND() works very well from the mysql command line but does not
work right through PHP.
The same bug was reported in september 2001 (Bug #13287) and was closed by
derick@php.net becuse he thought it was a mysql-bug
I know this is not a MySql-bug. It must be a bug in PHP becuse the
mysql-command line works fine.
--
Edit bug report at http://bugs.php.net/?id=22597&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22597&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22597&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22597&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22597&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22597&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22597&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22597&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22597&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22597&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22597&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22597&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22597&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22597&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22597&r=gnused