runnerjp Posted April 15, 2009 Share Posted April 15, 2009 how could i make the bleow code show radon friends?? <? $sql="SELECT friends.friendname, users.image FROM friends INNER JOIN users ON (users.Username=friends.friendname) WHERE friends.username='Admin' GROUP BY friends.friendname ORDER BY users.Username limit 9 "; $res = mysql_query($sql) or die(mysql_error()); echo "<table>"; $i = 0; while($row = mysql_fetch_assoc($res)){ $i++; if ($i % 3 == 0) echo '<tr>'; echo "<td><a href=\"http://www.runningprofiles.com/members/". $row['friendname'] ."\"><img src=\"http://www.runningprofiles.com/members/images/mini/" . $row['image'] . "\" /></a><br /> </td>"; if ($i % 3 == 0) echo '</tr>'; if( $i == 9 ) break; } echo "</table>"; ?> Link to comment https://forums.phpfreaks.com/topic/154246-solved-random-images/ Share on other sites More sharing options...
Maq Posted April 15, 2009 Share Posted April 15, 2009 Use RAND() in your query. Link to comment https://forums.phpfreaks.com/topic/154246-solved-random-images/#findComment-810921 Share on other sites More sharing options...
runnerjp Posted April 16, 2009 Author Share Posted April 16, 2009 LOVE IT! lol Link to comment https://forums.phpfreaks.com/topic/154246-solved-random-images/#findComment-811353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.