WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : This class splits the results of the query into multiple pages like what the search engine does.
Categories : PHP Classes, PHP, MySQL, Databases Update Picture
Sandeep Raja
Date : Feb 23rd 2001
Grade : 3 of 5 (graded 6 times)
Viewed : 8569
File : split.tar.gz
Images : No Images for this code example.
Search : More code by Sandeep Raja
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?

//Usage :
//=======



/* this is an example which splits the query results into multiple pages as search engine does
you can change the query and format in which the result is being printed
*/
include("split.class.php3");



$sql="select * from TABLE"; //query

$ord=new Split($sql,10); //create an object of split pass the sql and total no of rows to
be displayed in a page
if($ord->error!="")
{
die("ERROR" . $ord->error);
}

$rows=$ord->display($ppage);

$pages=$ord->total(); //get the total no of pages



while($myrow=mysql_fetch_row($rows))
{
//print the results over here

printf("Name is $myrow[0]<br>"); //this is just a test value
}
//*************************************************************************
******************

// now the links to other pages will be displayed with back and next

//*************************************************************************
*******************
if(($ppage=="")||($ppage<="0") )
{
$ppage=1; //as default if the requested page is less than 0 the first page
is printed
}
if($ppage > $pages)
{
$ppage=$pages; //if the requested page is greater than total pages the last page
is shown
}
if($ppage>1)
{
$backpage=$ppage-1;
printf("<a href=example.php3?ppage=$backpage>Back</a>&nbsp;&nbsp;&nbsp;");

}
//echo $pages;
for($j=1;$j<=$pages;$j++)
{
if($j==$ppage)
{
echo $j;
}
else
{
printf("<a href=example.php3?ppage=$j>$j</a>&nbsp;&nbsp;&nbsp;");
}
}
if($ppage<$pages)
{
$nextpage=$ppage+1;
printf("<a href=myexample.php3?ppage=$nextpage>Next</a>&nbsp;");

}
?>



Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
Setting up InnoDB on MySQL and using Transactions Begin, Commit, Rollback in PHP.
Categories : PHP Classes, Databases, PHP, MySQL, InnoDB
PHP Object Example of the Perl DBI with MySQL
Categories : PHP, PHP Classes, MySQL, Databases, Perl
Link Manager for Link Exchangers
Categories : PHP, PHP Classes, Databases, MySQL, CURL
A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP
Simple database class
Categories : PHP, PHP Classes, MySQL, Databases
Ajax PHP Tree (Left and Right) with MySQL
Categories : PHP, Databases, MySQL, AJAX, PHP Classes
YellowPages Content Grabber (PHP5 +)
Categories : PHP, PHP Classes, Regexps, Databases, MySQL
Convert SQL from oracle,mysql,mssql,sqlite and odbc to SQL compatible
Categories : PHP, PHP Classes, Databases, MySQL, MS SQL Server
MySQL Connection/Query Class
Categories : Databases, MySQL, PHP, PHP Classes
MySQL Handler
Categories : PHP, Databases, MySQL, Classes and Objects, PHP Classes
MySQL Class to ease Database connectivity
Categories : MySQL, PHP Classes, Databases, PHP
PHP Transfer data from text file to Mysql Table
Categories : PHP, PHP Classes, Filesystem, Databases, MySQL
Simple Mini Poll class library (SimPoll)
Categories : PHP, PHP Classes, Databases, MySQL, Complete Programs
Sort the results from a SELECT query (any number of columns) into an array automatically.
Categories : PHP, PHP Classes, Arrays, Databases, MySQL
 Kellog MK wrote :895
Very useful script to make a search engine !!! Thanks a lot, man!