Simple PHP Pagine

This is a simple php pagine file and You can change this according to your needs.I published this because when I need a pagine file I couldn't find.
line no 03 set the number of result rows. ex-number of product in the page
line no 04 and 05 set the start result row and end row.

$eu =0;

The query will retrieve the specific portion of data that limit by the start and end values.

$query=" SELECT * FROM student_adv limit $eu,$page_end";
echo mysql_error();

while($noticia = mysql_fetch_array($result))

echo "";
echo " $noticia[id]";
echo " $noticia[name]";
echo " $noticia[class]";
echo " $noticia[mark]";

echo "";

Retrieve all the data and count the number of rows in the result.line no 06 count the number of pages.line no 12 print the page numbers and pass the start and end row for the next page.

$query2=" SELECT * FROM student_adv ";
echo mysql_error();
//setting pages
print "";

for($i=0;$i<$pages_count;$i++) { $limitp=$limit; $end_limit=$i*$limit; print " ".$i.""; }

I will appreciate your comments.Let me know any errors or improvements.

No comments:

Post a Comment