I'm trying to build a news panel for my home page. Basically I want to present the five most recent news articles in a recordset, but I'm not sure how to cut off the recordset after 5.
Also I want to present a picture with my first headline.
My code will go something like this:
<?php
// Start News Wotsit.
// Create Recordset
$gubbins = "SELECT * FROM tblContent WHERE pageParent = 3 ORDER BY pageDate DESC";
$resGubbins = mysql_query($gubbins,$conn);
$rowsGubbins = mysql_fetch_assoc($resGubbins);
echo "<p> </p>\n";
echo "<table cellpadding=3 cellspacing=0 border=0><tr><td width=75>\n";
echo "<img src=\"/i/s/";
//echo pageImage
echo "\" width=\"75\"/>\n";
echo "</td><td width=\"225\">";
// echo pageTitle
// echo pageContent
echo "</td></tr>\n";
//Begin Loop articles 2-5
// Not sure how to make the loop start at the 2nd record
echo "<tr><td> </td>\n";
echo "<td><p><strong>";
//echo pageTitle
echo "</strong> ";
// echo pageContent
echo "<a href=\"/news/page.php?pageID=";
//echo page ID
echo "\">Read More...</a></p></td></tr>\n";
//end loop
}*/
echo "</table>\n";
} ?>
I can see in my head how this should work but I' don't really understand how to do things like print the value of pageTitle for the nth record in the set.
Any pointers would be gratefully received.
Matt
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php