Click here to Skip to main content
16,005,281 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: cakephp Pin
Marc Firth5-May-09 3:05
Marc Firth5-May-09 3:05 
Questionphp enabled code for ajax implementation in IE8 Pin
balanandakumar28-Apr-09 21:10
balanandakumar28-Apr-09 21:10 
AnswerRe: php enabled code for ajax implementation in IE8 Pin
Marc Firth29-Apr-09 1:26
Marc Firth29-Apr-09 1:26 
QuestionSIP server Pin
yogesh_softworld12323-Apr-09 9:33
yogesh_softworld12323-Apr-09 9:33 
AnswerRe: SIP server Pin
Divyang Mithaiwala4-May-09 1:41
Divyang Mithaiwala4-May-09 1:41 
Questionpaging in php [modified] Pin
umeshdaiya23-Apr-09 1:33
umeshdaiya23-Apr-09 1:33 
AnswerRe: paging in php Pin
Marc Firth26-Apr-09 21:55
Marc Firth26-Apr-09 21:55 
AnswerRe: paging in php Pin
Right Handed Monkey4-May-09 3:01
Right Handed Monkey4-May-09 3:01 
Basically you are going to use a technique similar to that in a previous post:
http://www.codeproject.com/script/Forums/View.aspx?fid=1640&msg=1742252[^]

Your sql queries will use the LIMIT keyword which specifies the number of pages a query is broken into and how many results to display. In MySQL it's like this

SELECT COUNT(*) AS total_pages FROM `table01`;
$result = $dbHandle->query($sql);
$row = $result->fetch_assoc();
$total_rows = $row['total_pages'];
//You'll need to calculate the end page, to display links to prev and next
$end_page = ceil($total_rows/$span);

SELECT * FROM `table01` LIMIT 0, 10;

where 0 is the current page being viewed (0 indexed) and 10 is the number of elements to return ($span).

in your code, the query will be: "SELECT * FROM `table01` LIMIT $cur_page, $span"
and $cur_page will be a GET requested variable

$cur_page = $_GET['page'];
if (!$cur_page)
$cur_page = 0;

Now display the results of the above query.

Then display the previous and next links however you like

display_link("page.php?cur_page=".$cur_page--); //prev
display_link("page.php?cur_page=".$cur_page++); //next


You can find a nicely formatted display was found on the web:
http://www.phpeasystep.com/phptu/29.html[^]
QuestionHex editing a binary file - is this possible with PERL or VBS Pin
danknugz22-Apr-09 6:58
danknugz22-Apr-09 6:58 
AnswerRe: Hex editing a binary file - is this possible with PERL or VBS Pin
danknugz24-Apr-09 12:59
danknugz24-Apr-09 12:59 
GeneralRe: Hex editing a binary file - is this possible with PERL or VBS Pin
TiGuCo6-Jul-09 13:41
TiGuCo6-Jul-09 13:41 
AnswerRe: Hex editing a binary file - is this possible with PERL or VBS Pin
John16-Feb-11 12:27
John16-Feb-11 12:27 
QuestionChampionship Manager 2009-clone for Mandriva? Pin
Kristoffer Grundström22-Apr-09 0:49
Kristoffer Grundström22-Apr-09 0:49 
AnswerRe: Championship Manager 2009-clone for Mandriva? Pin
Jimmanuel22-Apr-09 2:42
Jimmanuel22-Apr-09 2:42 
QuestionI want to integrate Nochex Creditcard payment within my PHP website itself. Pin
kvsuba21-Apr-09 19:30
kvsuba21-Apr-09 19:30 
AnswerRe: I want to integrate Nochex Creditcard payment within my PHP website itself. Pin
Marc Firth22-Apr-09 1:35
Marc Firth22-Apr-09 1:35 
AnswerRe: I want to integrate Nochex Creditcard payment within my PHP website itself. [modified] Pin
Marc Firth22-Apr-09 1:36
Marc Firth22-Apr-09 1:36 
Questionhow to save pdf file in mysql database using PHP code Pin
chandru7020-Apr-09 5:15
chandru7020-Apr-09 5:15 
AnswerRe: how to save pdf file in mysql database using PHP code Pin
Marc Firth20-Apr-09 22:12
Marc Firth20-Apr-09 22:12 
GeneralRe: how to save pdf file in mysql database using PHP code Pin
Marc Firth21-Apr-09 22:45
Marc Firth21-Apr-09 22:45 
GeneralRe: how to save pdf file in mysql database using PHP code Pin
robcole99925-Jun-09 10:32
robcole99925-Jun-09 10:32 
QuestionExport mysql to excel with php Pin
hqi8819-Apr-09 0:48
hqi8819-Apr-09 0:48 
AnswerRe: Export mysql to excel with php Pin
Marc Firth20-Apr-09 22:09
Marc Firth20-Apr-09 22:09 
QuestionAttendance tracking from card Reader in PHP Pin
Ritu066618-Apr-09 21:03
Ritu066618-Apr-09 21:03 
AnswerRe: Attendance tracking from card Reader in PHP [modified] Pin
fly90418-Apr-09 23:23
fly90418-Apr-09 23:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.