Jump to content

what would i add to this code to make it show only the most recent entry....


jbrill

Recommended Posts

Hey guys,

 

just wondering what i would add to the code below to only show the most recent entry. probably somethind like order by "startdate" and i would like it to only limit to one.

 

thanks,

 

 

<?php
$result = mysql_query("SELECT * FROM news WHERE CURDATE() BETWEEN startdate AND expdate;");
while($row = mysql_fetch_array($result))
  {
  echo "<p>" . $row['title'] . "</p>";
  echo "<p class=\"SWhiteText\">" . substr($row['content'],0,500) . "</p>";
   }
?>   

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.