How To Create Bootstrap 3 Pagination Using Php And Mysql


1
Listing Type
List Category
Tutorials
Location
Bur Dubai
Last update
Pagination:- Pagination is the process of organizing content by dividing it into separate pages.

Example :-1


Bootstrap 3 Pagination using php and mysql :-





Bootstrap 3 Pagination using php and mysql




$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$dbname = 'databasename';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$connection = mysql_select_db($dbname) or die ('Error connecting to mysql database');

$limit=5;
$page =$_GET["page"];

if($page=="" || $page==1)
{
$page1=0;
}
else
{
$page1=($page*$limit)-$limit;
}

$res = mysql_query("SELECT * FROM tablename ORDER BY id ASC LIMIT $page1, $limit") or die ('Error connecting to mysql query');

?>
while ($row = mysql_fetch_assoc($res))
{

echo "Id - ".$row['id']."
";
echo "name - ".$row['name'];
echo "
";

};
?>
$result = mysql_query("SELECT * FROM tablename");
$row = mysql_num_rows($result);
$total_pages = ceil($row / $limit);
$pagLink = "
    ";
    for ($i=1; $i<=$total_pages; $i++)
    {
    $pagLink .= "
  • ".$i."
  • ";
    };
    echo $pagLink . "
";
?>

php and mysql Pagination with Bootstrap 3


https://www.youtube.com/watch?v=takddjxhWT0

Source: YouTube
Distance Education In Dubai
Dubai, United Arab Emirates

9966416345
REPLY TO THIS CLASSIFIED
7 + 4 =