Hi,
I want to change this code as given 1 result. I don't need 10 line results. I just need 1 line result. When I tried to change 10 with 1 it doesn't work. Please help me about that.
while( $row = mysql_fetch_array($query) )
{
$id[] = $row['id'];
}
$id = array_flip($id);
$random_id = array_rand($id, 10);
$random_id = implode(',',$random_id);
$sql1 = 'SELECT * FROM table WHERE id IN(' .$random_id. ')';
$query1 = mysql_query($sql1);
while( $row1 = mysql_fetch_array($query1) )
{
echo $row1['name'].'<br>';
}