Ajax Tutorials, PHP Tutorials, Javascript Tutorials, Visual Basic.Net Training, XHTML tutorials, php script library, PHP Codes, Programming tutorials, web development tutorials
Home
|
Forums
|
Downloads
|
Books
|
Submit Content
|
Links
Programming Articles
PHP articles
MySql articles
Visual Basic.Net articles
Java articles
ASP articles
ASP.Net articles
Visual Basic articles
CSS articles
Programming Tutorials
PHP tutorials
MySql tutorials
Visual Basic.Net tutorials
Java tutorials
ASP tutorials
ASP.Net tutorials
Visual Basic tutorials
HTML tutorials
CSS tutorials
Programming Source Codes
PHP scripts
Visual Basic.Net scripts
JavaScript scripts
ASP scripts
ASP.Net scripts
Visual Basic scripts
Our Partners
Free Resources
Publisherbank
Free Link Directory
PHP Magazine
Webmaster Passion
Search Engine Bank
Free Directory Site
Free PHP Scripts
Links Shopping Mart
Variety Bazar
Urdu Office Tutorials
Evernew Scripts
Evernew Scripts
Evernew Directory
Our Achievements
Web templates
Buy and Sell Templates
Text Link Traders
Directory Metro
Gifts Choice
Valentines Ecards
Template Directory
Paging in PHP/MYSQL
Author
:
Date:
2006-02-27
Demo:
N/A
Description :
Paging in PHP/MYSQL
include("dbconfig.php"); if(!isset($start)) { // This variable is set to zero for the first page $start = 0; } $eu = ($start - 0); $limit = 15; // No of records to be shown per page. $this = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $sql_query2=" SELECT * FROM students"; $sql_result2=mysql_query($sql_query2); echo mysql_error(); $nume=mysql_num_rows($sql_result2); $query="SELECT * FROM students limit $eu, $limit "; $result=mysql_query($query); print "
"; print "
"; print "
"; print "
"; print "
"; print "
Name
"; print "
Class
"; print "
Date
"; print "
Fee
"; print "
"; //////////////// Now we will display the returned records in side the rows of the table///////// while($rows = mysql_fetch_array($result)) { print "
"; print "
".$rows['name']."
"; print "
".$rows['class]."
"; print "
".$rows['join_date']."
"; print "
".$rows['fee']."
"; print "
"; } print "
"; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "
"; echo "
"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0) { print "
PREV
"; } else{ //print "
PREV
"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// print " "; if($this < $nume) { print "
NEXT
"; } else{ //print "
NEXT
"; } echo "
"; echo "
"; echo "
"; ?>
Add Comment:
Name:
Email:
Subject:
Message:
Desclaimer
|
Privacy Policy
|
Submit Content
|
Links
|
Link to Us
|
Sitemap
|
Contact Us
Copyright Programming Tutorials, Web Development Tutorials, Source codes © All Rights are Reserved.
Powered By
Evernew Solutions
Credit Card Consolidation
-
Credit Counseling
-
Remortgage
-
Vegas Hotel