Target 1st record of a Select query

Im trying to create a simple forum uusing a mysql database,
Here is a list of my topics,
http://coronadoshores.ca/community/
Heres the post in 1 of those topics,
http://coronadoshores.ca/community/category.php?id=1&topic=Welcome
if you click on the replies link it shows; the post, as well as both of its replies,
http://coronadoshores.ca/community/post.php?id=3

I want to target the 1st record in that query

SELECT mess.subject, mess.message_txt, mess.mess_id, mess.parent_id, mess.created, users.name
 FROM messages AS mess
INNER JOIN `users` 
ON users.id =  mess.user_id
WHERE mess.parent_id = :id
OR mess.mess_id = :id
GROUP BY mess.created

so I can style the post like it is in the category page (and only have the replies be blockquotes

while($row = $stmt->fetch()) {
echo "<blockquote><h3>{$row['subject']}</h3><p>".$row['message_txt']."</P>";
echo "<footer class='pull-right'>".$row['name']." on ".$row['created']."</footer>";
echo "</blockquote>";
}

If you’re just looking to style it, why not use the first-of-type css selector?

I can use CSS styles like,

blockquote:first-of-type { }

to convert

<blockquote>
<h3>Where is the...?</h3>
<p>blah blah blah...</P>
<footer class='pull-right'>Jason Cannon on 2014-10-28 13:26:16</footer></blockquote>

to

<div class='panel panel-default'>
<div class='panel-heading'>
<h3 class='panel-title' style='margin-right:175px; font-size:150%'>Where is the...?</h3>
</div>
<table class='table table-bordered table-condensed' style='width:auto'>
<tr><td><span class='glyphicon glyphicon-user' style='margin:0 10px'></span>Post by Jason Cannon</td></tr>
<tr><td><span class='glyphicon glyphicon-time' style='margin:0 10px'></span>on 10/28/14 1:26 PM</td></tr>
</table>
<div class='panel-body comment more'>blah blah blah ... </div></div>	</div>

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.