Codice PHP:
$id=rand(1,10);
$query"SELECT * FROM news where id='$id'"