garry Posted June 1, 2008 Share Posted June 1, 2008 So what I want to have is a table with the latest reviews from my database and I want to have two results per row on the table. Here's the query I'm using: SELECT reviews.id AS reviewid, reviews.artist_id, reviews.album_id, artists.id AS artistid, artists.artist, albums.id AS albumid, albums.title, albums.thumb FROM artists, reviews, albums WHERE reviews.artist_id = artists.id AND reviews.album_id = albums.id ORDER BY reviews.created_at DESC LIMIT 5 And then I use a while loop to have a new <tr> for each result. How can I change this so I can have the first two results in a <tr> and the next two in another.. and so on.. Thanks! Link to comment https://forums.phpfreaks.com/topic/108216-doing-something-to-every-second-result-from-query/ Share on other sites More sharing options...
GingerRobot Posted June 1, 2008 Share Posted June 1, 2008 See this FAQ/code snippet. Its just what you're after. Link to comment https://forums.phpfreaks.com/topic/108216-doing-something-to-every-second-result-from-query/#findComment-554696 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.