<?php
$con=mysqli_connect("localhost","root","","payroll");
$per_page = 2; //per page record
$pages_query = mysqli_query($con, 'SELECT COUNT(id) FROM employee');
$row = mysqli_fetch_array($pages_query);
$pages = ceil($row[0] / $per_page);
//echo $pages;
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1; //page number throung url
$start = ($page - 1) * $per_page;
$sql="SELECT * FROM employee LIMIT $start, $per_page";
$query = mysqli_query($con,$sql);
while($row=mysqli_fetch_array($query))
{
echo "id is" .$row['id'];
echo $row['name'];
echo $row['phone'];
echo $row['salary'];
echo '<br>';
}
$prev = $page - 1;
$next = $page + 1;
if(!($page<=1))
{
echo "<a href='pag.php?page=$prev'>Prev</a> ";
}
if($pages>=1 && $page<=$pages){
for($x=1;$x<=$pages;$x++){
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ';
}
}
if(!($page>=$pages))
{
echo "<a href='pag.php?page=$next'>Next</a>";
}
?>
$con=mysqli_connect("localhost","root","","payroll");
$per_page = 2; //per page record
$pages_query = mysqli_query($con, 'SELECT COUNT(id) FROM employee');
$row = mysqli_fetch_array($pages_query);
$pages = ceil($row[0] / $per_page);
//echo $pages;
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1; //page number throung url
$start = ($page - 1) * $per_page;
$sql="SELECT * FROM employee LIMIT $start, $per_page";
$query = mysqli_query($con,$sql);
while($row=mysqli_fetch_array($query))
{
echo "id is" .$row['id'];
echo $row['name'];
echo $row['phone'];
echo $row['salary'];
echo '<br>';
}
$prev = $page - 1;
$next = $page + 1;
if(!($page<=1))
{
echo "<a href='pag.php?page=$prev'>Prev</a> ";
}
if($pages>=1 && $page<=$pages){
for($x=1;$x<=$pages;$x++){
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ';
}
}
if(!($page>=$pages))
{
echo "<a href='pag.php?page=$next'>Next</a>";
}
?>
Such useful information provided by you. These details are both very beneficial for both newbies and experienced ones. Thank you for the post.
ReplyDeleteWeb Design Company | Web development Lucknow
Thanks For Sharing. It IS very helpful For Everyone ....
ReplyDeleteIf You Are Looking Best PHP training in chandigarh click here
Great and helpful post and Thanks for sharing this article. we are leading the Best PHP training institute and web development and designing training in Jodhpur .
ReplyDeleteThanks for sharing the post.
ReplyDeletedigital marketing training in bhopal
digital marketing training in bhopal
SEO training in bhopal
PHP training in bhopal
PHP training in bhopal
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeleteapplication developers in hyderabad
ios app development company in hyderabad
mobile app development in gachibowli
bmobile app development in kukatpally
mobile app development in ameerpet
This site is help full for every person and easily get money through bitcoin atm card .please visit this site for bitcoin atm card ranking.you can change any money into another currency in any where in the world.
ReplyDeleteI am really happy to say it’s an interesting post to read . I learn new information from your article , you are doing a great job . Keep it up.
ReplyDeletePhp Training Courses in mumbai
There is no better idea of keeping your mobile loaded with balance all the time. If you are also looking for any useful way to utilize your top up phone with bitcoin then hurry up and avail our service as much as can. There is no limit of it. Make your mobile life happier with balance recharge through NETELL.NET. COME SOON .THANK YOU .
ReplyDeleteWant to get ranked your business on the top? Contact Shahni Digital Media, one of the fastest growing Digital Marketing Company in India. We provide web development solution, orm, ppc, smm, sem etc.
ReplyDeleteDigital Marketing Company Bhopal
Website Designing Company Bhopal
SEO Company in Bhopal
ORM Company India
Thanks for sharing the valuable information with us.These are really great and useful in all aspects,appreciated!
ReplyDeletePHP-MySQL Interview Questions
Top 10 PHP Interview Questions
PHP Functions asked in Interview