mcmuney Posted November 7, 2006 Share Posted November 7, 2006 If I'm displaying a top 25 list of items using LIMIT 0,25, how can I apply a specific identifier to the top 3 items. For example, lets say that for the top 3 I want to show a 1st, 2nd and 3rd IMAGE and the remaining 22 items show nothing, how can I do that.1 result from db & 1st.gif2 result from db & 2nd.gif3 result from db & 3nd.gif4 result from db5 result from db...25 result from db Link to comment https://forums.phpfreaks.com/topic/26398-top-3-list/ Share on other sites More sharing options...
Fuego Posted November 7, 2006 Share Posted November 7, 2006 You could use a simple counter that only goes up to three.$i=0;while($row = mysql_fetch_array($result)){ echo $result['name']; if($i<3){ <img .... $i ...> } $i++;} Link to comment https://forums.phpfreaks.com/topic/26398-top-3-list/#findComment-120720 Share on other sites More sharing options...
mcmuney Posted November 7, 2006 Author Share Posted November 7, 2006 Can you elaborate a bit where if $i<3 show images. I'll need to use 3 different images for each spot (ie 1, 2 3).Thanks. Link to comment https://forums.phpfreaks.com/topic/26398-top-3-list/#findComment-120724 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.