Andreas Paasch wrote:
dr. zoidberg wrote:
Hello,
I'm pulling news titles from MySQL. How Can I display first record
in
bold (different than other ones). What is the best way to do that.
Is
there some 'magic' query or PHP function.
*First Headline*
Second Headline
Third Headline
TNX
I would look into mysql_num_rows == 1 ... if your select statement is
made
orderly.
If the value is one, then print in bold ... else don't.
/Andreas
As far as I know there is no single SQL line that can solve your problem.
you need to check the pointer location, and the best way will be something
like this:
$query_headline = mysql_query ("SELECT headline FROM headlines") or die
("Query failed!");
$first_row = true;
while ($row=mysql_fetch_array($query_headline)){
if ($first_row)
{
echo "<b>".$row['topicName']."</b><br />";
$first_row = false;
} else
{
echo $row['topicName']."<br />";
}
}
Hope it helps...
##-----------------------------------------------#
Article posted from PHP Freaks NewsGroup
http://www.phpfreaks.com/newsgroup
Get Addicted: comp.lang.ph
##-----------------------------------------------##