Hello,
I followed along with the www.spoono.com tutorial for making previous next links with my journal. It works fine, the only thing is, my data is not displaying one at a time, they all display on every page, can anyone help me qweek my code?
<?
mysql_pconnect("localhost","***","*****");
mysql_select_db("simplebit_com");
if(!$rowstart) $rowstart=0;
$result = mysql_query("select * from news limit $rowstart,1");
$result2 = mysql_query("select * from news");
//put all the code here for running the script itself using $result in the while loop
while ($directory = mysql_fetch_array($result2)) {
$id = $directory['id'];
$title = $directory['title'];
$entry = $directory['entry'];
$date = $directory['date'];
echo "$date<br><br>";
echo "<b>$title</b><br><br>";
echo "$entry<br><br><br>";
}
if ($rowstart>$numrows)
{?>
<A HREF="<? $php_self ?>?rowstart=<? echo $rowstart-1;?>">
< Previous Page</A>
<?}?>
|
<?
$numrows=mysql_num_rows($result2);
if($rowstart+1<$numrows)
{?>
<A HREF="<? $php_self?>?rowstart=<?echo $rowstart+1 ;?>">
Next Page ></A>
<? } ?>