Your question is vague. What platform are you using, Windows, Linux, is web server Apache or IIS? What database are you using?? If you are trying to create php grid from scratch, you should take a look an existing solution such as
phpGrid that pulls data from a database and handles pagination automatically for you.