mysql_version or mysql_status($varname) for fast rand
| From: | Reini Urban | Date: | Fri, 23 Feb 2001 02:52:05 +0000 |
| Subject: | mysql_version or mysql_status($varname) for fast rand | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6898@lists.php.net to get a copy of this message | ||
I'd need one of those functions.
I would want to use the much faster "SELECT ... ORDER BY RAND() LIMIT 1"
but at least one server of mine doesn't support RAND().
I want to detect that dynamically. no way?
for this old mysql I must use:
$res = mysql_query("select xx from xx", $dbi);
$rows = mysql_num_rows($res);
return mysql_result($res, rand(1,rand($rows)));
please CC to me also because i'm not subscribed to this list.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/