Chrisj Posted December 30, 2009 Share Posted December 30, 2009 I'm testing a jukebox style container that displays video thumbnails in a paging/jukebox appearance on a web page. Can you tell me how I might make a change so the thumbnails don't appear randomly each time it displays? Here is the php dode. Thanks for any help/suggestions. <?php include("../classes/config.php");?> <artworkinfo> <? $query = "select * from videos where viewtime<>'0000-00-00 00:00:00' and public_private='public' AND approved ='yes' AND promoted ='yes' order by rand() limit 10"; // Max 10!"; $db=mysql_connect ($dbhost,$dbusername,$dbpassword) or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ($dbname); $num_rows = mysql_num_rows(mysql_query("select * from videos WHERE public_private = 'public' AND promoted = 'yes' AND approved ='yes'")); $result = mysql_query($query) or die ('Query Error: ' . mysql_error()); while ($results = mysql_fetch_array($result)) { ?> <albuminfo> <artLocation>../uploads/thumbs/<?=$results['video_id']; ?>.jpg</artLocation> <artist> CLICK HERE !!</artist> <albumName><?=$results['title']; ?></albumName> <artistLink>../play.php?vid=<?=$results['indexer']; ?>&src=jukebox</artistLink> <albumLink>../play.php?vid=<?=$results['indexer']; ?>&src=jukebox</albumLink> </albuminfo> <? } mysql_close(); ?> </artworkinfo> Quote Link to comment https://forums.phpfreaks.com/topic/186739-how-to-change-it-so-thumbnails-arent-displayed-randomly/ Share on other sites More sharing options...
sKunKbad Posted December 31, 2009 Share Posted December 31, 2009 How about take out the "order by rand()" that's in your first query. Quote Link to comment https://forums.phpfreaks.com/topic/186739-how-to-change-it-so-thumbnails-arent-displayed-randomly/#findComment-986313 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.