web_master Posted March 16, 2008 Share Posted March 16, 2008 hi, in database I have 100 product names. how can I list randomly this names from dbase - in marquee? <?php $query_random = mysql_query("SELECT * FROM `productgroups_2` ORDER BY `productgroups_2_id` ASC"); while($request_random = mysql_fetch_array($query_random)) { ?> <marquee><?php print $request_random['product_name'];?></marquee> <?php }?> in advanced thnxs Quote Link to comment Share on other sites More sharing options...
affordit Posted March 16, 2008 Share Posted March 16, 2008 $query = "SELECT * FROM `text_content` ORDER BY RAND() LIMIT 0,1"; $results = mysql_query($query) or die(mysql_error()."<br /><br />".$query); $info = mysql_fetch_array($results); Quote Link to comment Share on other sites More sharing options...
web_master Posted March 16, 2008 Author Share Posted March 16, 2008 hi, its work fine, but what happened? - The random is working perfectly, but in marquee print only 1 product until next reload. So, I want to list randomly on one reload all the products. Quote Link to comment Share on other sites More sharing options...
web_master Posted March 16, 2008 Author Share Posted March 16, 2008 no help? ??? Quote Link to comment Share on other sites More sharing options...
Orio Posted March 16, 2008 Share Posted March 16, 2008 <?php $query_random = mysql_query("SELECT * FROM `productgroups_2` ORDER BY RAND()"); while($request_random = mysql_fetch_array($query_random)) echo "<marquee>".$request_random['product_name']."</marquee><br />"; ?> Orio. Quote Link to comment Share on other sites More sharing options...
web_master Posted March 16, 2008 Author Share Posted March 16, 2008 Orio, super, THNXS! Quote Link to comment 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.