Skip to content

Instantly share code, notes, and snippets.

@necenzurat
Created September 4, 2012 22:04
Show Gist options
  • Save necenzurat/3627151 to your computer and use it in GitHub Desktop.
Save necenzurat/3627151 to your computer and use it in GitHub Desktop.
select random row from big mysql table
$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