Created
September 4, 2012 22:04
-
-
Save necenzurat/3627151 to your computer and use it in GitHub Desktop.
select random row from big mysql table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$to = mysql_fetch_row(query("SELECT COUNT(*) FROM produse")); | |
$rand = rand(1, $to[0]); | |
$result = mysql_fetch_row(query("SELECT * FROM produse where id =$rand")); | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment