PLEASE HELP needed.....
how do i include a paging on this code. :-(
<?
// Here below i include my database information
include("_db/db.settings.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM news ORDER BY ID DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?
// Here i post it on screen, but i post all posts i only want 10
// on each screen, please advice.
$i=0;
while ($i < $num) {
$subject=mysql_result($result,$i,"subject");
$text=mysql_result($result,$i,"text");
$writer=mysql_result($result,$i,"writer");
$date=mysql_result($result,$i,"date");
$homepage=mysql_result($result,$i,"homepage");
$id=mysql_result($result,$i,"id");
?>
</strong> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../images/design/border1.gif"><img src="images/design/ds_subject2.gif">
<strong><font color="#FFFFFF"> OnlineNews | ID: NWS<? echo "$id "-00 ?>-00</font></strong></td>
</tr>
<tr>
<td> <blockquote>
<p><strong> Subject:</strong> <? echo "$subject"; ?> | <strong>Date:</strong>
<? echo "$date"; ?> | <strong>Posted by:</strong> <? echo "$writer"; ?>
<br>
<br>
<? echo "$text"; ?>
<br>
<br>
<table width="100%" height="3" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="3" valign="bottom" background="images/design/border1b.gif"><strong><strong><img src="images/design/ds_download2.gif">
News source: <a href="<? echo "$homepage " ?>" target="_parent"> Click
here to continue</a></strong></td>
</tr>
</table>
</blockquote> </td>
</tr>
<?
++$i;
}
echo "</table>";
?>
Please help i want a paging function. exaple shown below.
<< « 1 | 2 | 3 | 4 | 5 | » >>
Note << First page and this >> is for last page
« (a single page step backward)
» (a single page step forward, next page)
Thanx in advance. btw. please dont post use search engine to find what you a looking for because it didnt help me. Sorry a newbie in desperate need of help.