MySQL query limit part of query

LeonardO20

New Member
I have a mysql query:\[code\]$result = mysql_query("SELECT * FROM $table WHERE cat = 'category'"); while($row = mysql_fetch_array($result)) { echo ' <hgroup><h3>'.$row['mag'].'</h3><h4>'.$row['date'].'</h4></hgroup> <a href="'.$row['href'].'" onclick="this.target=\'blank;\'">'.$row['title'].'</a> '; }\[/code\]This query will generally select between 2 and 5 different rows and display them in a list.I want the first echoed line to only appear once and the second line should appear between 2 and 5 depending on the data in my db.I am sure there is a simple way to do this, I've tried GROUP BY mag but this will eliminate the remaining 1-4 pieces of data I wish to display.
 
Back
Top