Hi I have spent most of the day on this and turn to you in the hope someone can help. I need to generate a random display 5-10 embedded youtube vids on a page without duplication. I can get the videos to display (but all of the same artist) when I refresh it displays a new set of videos but again all of the same artist. I know the answer is probably very simple but I just can't see it.
Any help or pointers would be most appreciated.
The initial php code is:
$result = mysql_query("SELECT Youtube FROM artist ORDER BY RAND() LIMIT 5");
$test = mysql_fetch_array($result);
if (!$result)
{
die("Error: Data not found..");
}
$Youtube=$test['Youtube'];
With the output being:
<div class="ws_images"><ul>
<iframe width="300" height="300" src="https://www.youtube.com/embed/<? php echo $Youtube ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="300" height="300" src="https://www.youtube.com/embed/<?php echo $Youtube ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="300" height="300" src="https://www.youtube.com/embed/<?php echo $Youtube ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="300" height="300" src="https://www.youtube.com/embed/<?php echo $Youtube ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe width="300" height="300" src="https://www.youtube.com/embed/<?php echo $Youtube ?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</ul></div>