-4

php file . i have more then 50 records in my mysql database so i need to display those records using pagination .. so kindly give me solution for me ., i have no idea about pagination ...

display.php

    <?php
include('connect.php');
$sql = "select * from member_table ORDER BY id DESC limit 0, 8 ";
$retain = mysql_query($sql, $con);
if (!$retain)
{
die ('no add posted yet' .mysql_error());
}
while($row = mysql_fetch_array($retain))
{
echo "id: {$row['id']}<br>".
     "Title:{$row['title']}<br>".
     "Description:{$row['description']}<br>".
     "Image:{$row['file']}<br><br><br>";
}
echo "you can view only last few adds";
?>

the above code shows all the records is single page . kindly guide me how to display using paging in php Thanks a lot in advance .........

Karthick
  • 73
  • 1
  • 1
  • 10
  • did you google it? http://code.tutsplus.com/tutorials/how-to-paginate-data-with-php--net-2928 – Sablefoste Jun 27 '14 at 17:52
  • k sable.....i expect exact code for my display.php code – Karthick Jun 27 '14 at 17:55
  • 3
    We aren't here to write your code. If you are getting an error with what you tried, we can help. But you have to show effort first. – Sablefoste Jun 27 '14 at 17:57
  • 3
    @user3427706 stackoverflow isn't a place to get free labour. Small 1-2 line problems when the person has tried yes, but just expecting someone to do all your work for you isn't what it is for. You have made no attempts yourself so and I doubt people will write it for you. – James Walker Jun 27 '14 at 17:58

1 Answers1

0

I hope this SQL example helped you:

SELECT * FROM Customers LIMIT 100

You can even page through the results like this:

SELECT * FROM Customers LIMIT 1000.50

return 50 records starting with the 1000

lmcDevloper
  • 332
  • 2
  • 8