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,
Heres the post in 1 of those topics,
if you click on the replies link it shows; the post, as well as both of its replies,

I want to target the 1st record in that query

SELECT mess.subject, mess.message_txt, mess.mess_id, mess.parent_id, mess.created,
 FROM messages AS mess
INNER JOIN `users` 
ON =  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

<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>


<div class='panel panel-default'>
<div class='panel-heading'>
<h3 class='panel-title' style='margin-right:175px; font-size:150%'>Where is the...?</h3>
<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>
<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.