php paging problem -
I have a php page with paging option
I want to generate the total number of pages I use SQL statement
$ rowspages = 25; $ Page name = 1; If (isset ($ _GET ['page'])) {$ pageNum = $ _GET ['page']; } $ Offset = ($ pgnium - 1) * $ rowspages; $ Query = "SELECT COUNT (id) as table number" $ result = mysql_query ($ query) or die ('error, query failed'); $ Line = mysql_fetch_array ($ result, MYSQL_ASSOC); $ Numrows = $ row ['numrows']; $ Max page = roof ($ points / $ rowspages);
I now have a code copy for writing next / previous page link
$ page = $ pageNum - 1; $ Prev = "& lt; a href = \" $ self? Page = $ page \ "class = \" rednorm \ "& gt; [previous]
My problem is:
When I pass a query sting with a page like abc.php? M = 1 and page = 2
The query string will not be available after clicking on that [Previous] / [Next] page link.
I can vouch for this problem
$ prev = "& lt; A href = \" $ self? Page = $ page \ "class = \" rednorm \ "& gt; [previous]
statement
How can I get the name of the page and all the query string in place of $ self because it is only receiving the page name.
Just add other variables to the link.
T know what they are / can be, you can try to do something like this:
$ q = "?"; Get foreign currency ($ _ $$ as Received => $ v) {If ($ k == "Page") will continue; $ Q = HTMLentities ($ k) "=" Heelentity ($ V) "& Amp; amp;"; } $ Page = $ pageNum - 1; $ Prev = "& lt; a href = \" $ self $ {q} page = $ page \ "class = \" rednorm \ "& gt; [previous]
All links on this link will add string variables, to pass it on to the next page.
Comments
Post a Comment