RE: RES: [PHP] paging
MySQL From: zechim@gmail.com To: tedd.sperl...@gmail.com; jd...@hotmail.com; php-general@lists.php.net Subject: RES: [PHP] paging Date: Tue, 10 Feb 2009 11:33:42 -0200 MySql or MsSql or other dB? -Mensagem original- De: tedd [mailto:tedd.sperl...@gmail.com] Enviada em: terça-feira, 10 de fevereiro de 2009 11:26 Para: Jim Douglas; php-general@lists.php.net Assunto: Re: [PHP] paging At 3:26 AM + 2/10/09, Jim Douglas wrote: Does anyone have a link to any examples of paging? Jim: Sure. http://webbytedd.com/bbb/paging/ -- the code is there different examples here: http://webbytedd.com/ccc/pagination Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Windows Live™: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_022009
RE: [PHP] paging
I saw your site originally. I have paging working and I also have this example working, http://www.w3schools.com/php/php_ajax_database.asp My problem is not getting paging to work, it's getting paging to work outputting the results of clicking on the page number to the content pane. I have a CSS that has left, right, header, footer and a content pane. After I click on the drop down it outputs to the content pane just fine. Thanks, Jim Date: Tue, 10 Feb 2009 08:26:23 -0500 To: jd...@hotmail.com; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: Re: [PHP] paging At 3:26 AM + 2/10/09, Jim Douglas wrote: Does anyone have a link to any examples of paging? Jim: Sure. http://webbytedd.com/bbb/paging/ -- the code is there different examples here: http://webbytedd.com/ccc/pagination Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Windows Live™: E-mail. Chat. Share. Get more ways to connect. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Faster_022009
[PHP] paging
Does anyone have a link to any examples of paging? I have this example up and running, http://www.w3schools.com/php/php_ajax_database.asp I have paging working as below, my problem is when I add a CSS style sheet I now have 4 panes. How can I direct the paging results to the content pane? ?php $q=$_GET[q]; $start=$_GET[start]; $con = mysql_connect('localhost', 'root', 'mypassword'); if (!$con) {die('Could not connect: ' . mysql_error());} mysql_select_db(bar, $con); $page_name=getbars.php; if(!isset($start)) {$start = 0;} $sql2=select * from bars WHERE geog_id = '.$q.'; $result2=mysql_query($sql2); echo mysql_error(); $nume=mysql_num_rows($result2); $eu = ($start - 0); $limit = 10; $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; $sql=select * from bars WHERE geog_id = '.$q.' limit $eu, $limit; $result = mysql_query($sql); echo table border='0'; while($row = mysql_fetch_array($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ff';} else{$bgcolor='#f1f1f1';} echo tr ; //echo td align=left bgcolor=$bgcolor id='title'nbsp;font face='Verdana' size='2'A HREF= . $row['bar_website'] .. $row['bar_name'] . /A/div/font/td; echo div id='lbBarList' /div; echo td align=left bgcolor=$bgcolor id='title'nbsp;font face='Verdana' size='2'A HREF= . $row['bar_website'] .. $row['bar_name'] . /A/div/font/td/div; echo /tr; } echo /table; if($nume $limit ){ // Let us display bottom links if sufficient records are there for paging /// Start the bottom links with Prev and next link with page numbers / echo table align = 'center' width='50%'trtd align='left' width='30%'; if our variable $back is equal to 0 or more then only we will display the link to move back if($back =0) { print a href='$page_name?start=$back'font face='Verdana' size='2'PREV/font/a; } } echo /tdtd align=center width='30%'; $i=0; $l=1; for($i=0;$i $nume;$i=$i+$limit){ if($i $eu){ //echo a href='$page_name?start=$i'font face='Verdana' size='2'$l/font/a ; echo a href='$page_name?start=$i'font face='Verdana' size='2'$l/font/a ; } else { echo font face='Verdana' size='4' color=red$l/font;} $l=$l+1; } mysql_close($con); _ Windows Live™: Keep your life in sync. http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_022009