at this moment it dispaly the last 5 rows.
<?php $link = mysql_connect("localhost", "root",""); mysql_select_db("test", $link); $query = "select * from post order by id DESC LIMIT 0, 5 "; $results = mysql_query($query, $link) or die ("the code didn't worked!".mysql_error()); if($results){ $i = 1; while ($row = mysql_fetch_assoc($results)){ echo $row['title']. "<img src=/1/" . $row['location']. " width=580px > " . "<br /><br /><br />"; } } ?>
i need a button "next" and "preview" so the rows displayed can change.
for ex. if i click on the button the code will change to this:
<?php $link = mysql_connect("localhost", "root",""); mysql_select_db("test", $link); $query = "select * from post order by id DESC LIMIT 5, 5 "; $results = mysql_query($query, $link) or die ("the code didn't worked!".mysql_error()); if($results){ $i = 1; while ($row = mysql_fetch_assoc($results)){ echo $row['title']. "<img src=/1/" . $row['location']. " width=580px > " . "<br /><br /><br />"; } } ?>