Jump to content

Displaying current articles in bold?


ryanwood4

Recommended Posts

I'm using the fairly simple below code to output a list of the latest articles, but I'm wanting (not sure if it's possible) to display the articles from the current day in bold so users recognise that they are new and the older ones non-bold.

 

I've tried a few things, but they're not giving the desired results.

 

<?php
		$con = mysql_connect("localhost","xxx","xxx");
		if (!$con)
  			{
  			die('Could not connect: ' . mysql_error());
  			}

		mysql_select_db("xxx", $con);

		$result = mysql_query("SELECT * FROM `articles` WHERE `quotes` NOT LIKE '%yes%' ORDER BY `date` DESC limit 0,14");

		echo "<table class='links' border='0' width='100%'>";

		while($row = mysql_fetch_array($result))
		{
		echo '<tr><td width="270" valign="top"><h4>» <a href="news/display/'.$row['id'].'">'.$row['title'].'</a></td><td width="40" valign="top"><span class="small">'.date("M d", strtotime($row['date'])).'</span></h4></td></tr>';
		}

		mysql_close($con);
		?>

 

Cheers!

Link to comment
https://forums.phpfreaks.com/topic/235803-displaying-current-articles-in-bold/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.