Greetings:
I am trying to limit the number of things that show up on the page. As the code is now it isnt doing that. I get all the items and a next link after each item. The desired output is 10 stories then a next/previous link at the bottom of the page to go to the next 10. Any help would be appreciated.
if(!isset($start)) $start = 0;
connection statements
$query = "SELECT DATE_FORMAT(news_date, '%M %d, %Y')
AS news_date1, news_id, news_title, news_body
FROM bm_news
LIMIT 10, 10
ORDER BY news_date DESC" or die(mysql_error());
$result = mysql_query ($query);
while($row = mysql_fetch_array($result))
{
$news_id = $row['news_id'];
$news_date = $row['news_date1'];
$news_title = $row['news_title'];
$news_body = $row['news_body'];
echo '<table border="0" width=95% cellspacing="0" height="1" cellpadding="0">';
echo '<br><tr><td width=20% height="1">
<p align="center">
<b>' . $news_title . '</b></p>
</td></tr></table><br>
<table border="0" width=95% cellspacing="0" height="1" cellpadding="0">
<tr> <td width=100% height="1">';
echo '<tr><td>' . $news_date . '
' . $news_body . '</td></tr></table>';
echo '<center><br><hr width="75%"><br></center>';
if($start > 0)
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start - 10) .
"\">Previous</a><BR>\n";
if($numrows > ($start + 10))
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start + 10) .
"\">Next</a><BR>\n";
}