Hello,
I have a table as :
id/category/title/date/text
what I want to do is, to display latest entries from each category. so if there are 10 categories, there should be 10 entries total. and each of those rows should be the latest of that category.
I wrote this but it gives error saying unexpected $end for the last line in the code below...Even if it doesnt give error I am not even sure if I set up the logic right for what I want.
for($i=1; $i<=13; $i++)
{
$sql="(select * from table1 WHERE 'category'=$i ORDER BY id DESC LIMIT 1)
}
ORDER BY date DESC LIMIT 2,1";
$query=mysql_query($sql);
?><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><?
while ($row = mysql_fetch_array($query)) {
$b=$row['id'];
$c=date("F j", strtotime($row['date']));
echo"<span id=newsdate1>".$c."</span>"."<span class='newstitle1'>" . "<br/>". $row['title'] . "</span>".
"<span id=newstext1>" . $row['par1'] ."<a href='news.php?id=$b'".">"."(more...)"."</a>" ; }?>
Please help.