Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how will i set pagination ?

Answers were Sorted based on User's Feedback



how will i set pagination ?..

Answer / rajkumar (rk)

This is the oracle pagination for PHP script... We need to include this in our PHP

<?
$lv_pages = OCIParse($con, $lv_qry);
OCIExecute($lv_pages);
while (OCIFetch($lv_pages))
{
$total = $total+(OCINumCols($lv_pages)-1);
}

$lv_start_rec = $_SESSION['lv_start_rec'];
$lv_end_rec = $_SESSION['lv_end_rec'];
if($_POST['lv_flag']!='')
{
if($_POST['lv_flag']=='1')
{
$lv_first_rec = 1;
$lv_last_rec = 10;
}
if($_POST['lv_flag']=='2')
{
if($lv_start_rec == 1 && $lv_end_rec == 10)
{
$lv_first_rec = 1;
$lv_last_rec = 10;
}
else if($lv_start_rec >= 1 && $lv_end_rec <= 10)
{
$lv_first_rec = 1;
$lv_last_rec = 10;
}
else
{
$lv_first_rec = $lv_start_rec - 10;
$lv_last_rec = $lv_start_rec - 1;
}
}
if($_POST['lv_flag']=='3')
{
if($lv_start_rec == ($total-10) and $lv_end_rec == $total)
{
$lv_first_rec = $total-10;
$lv_last_rec = $total;
}
else if($lv_end_rec >= $total)
{
$lv_first_rec = $lv_start_rec;
$lv_last_rec = $lv_end_rec;
}
else
{
$lv_first_rec = $lv_start_rec + 10;
$lv_last_rec = $lv_end_rec + 10;
}
}
if($_POST['lv_flag']=='4')
{
if ($total <= 10)
$lv_first_rec = 1;
else if (($total%10) == 0)
$lv_first_rec = $total - 10+1;
else
$lv_first_rec = $total - ($total%10) +1;

$lv_last_rec = $total;
}
}
else
{
$lv_first_rec = 1;
$lv_last_rec = 10;
}

$_SESSION['lv_start_rec'] = $lv_first_rec;
$_SESSION['lv_end_rec'] = $lv_last_rec;

?>

Is This Answer Correct ?    2 Yes 2 No

how will i set pagination ?..

Answer / rajkumar (rk)

Pagination is a big program... we can make using limit function

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More PHP Interview Questions

How send email in php?

0 Answers  


How can we get the browser properties using PHP?

4 Answers   Google, Pollux Softech,


How to get tabels from database in php andd display it in the table form using codelgniter? plz help me

2 Answers  


How to get the number of visitors in a site?

2 Answers  


What difference between require() and require_once()?

0 Answers  


how much a fresher php programmer can earn in india

5 Answers  


What is the use of preg_match in php?

0 Answers  


What is ci framework in php?

0 Answers  


Tell me which function gives us the number of affected entries by a query?

0 Answers  


Which is the Best plateform for PHP?

7 Answers   DLF, Net Solution,


Explain how we can retrieve the data in the result set of mysql using php?

0 Answers  


"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.

0 Answers  


Categories