Ok... I have another problem. I have tryed to split the resultts of my query in to multiple pages with a fixed number of results per page... I used this tutorial for it:
http://www.php-mysql-tutorial.com/php-mysql-paging.php
Originally, my page worked as follows:
There was a search frame where the user would select different things through dropdown lists or checkboxes... hisselections were sent via a post method as parameters to the "display" page.
On the display page those parameters were obtained through the "$_request" or "$_post" methodes and asigned to local variables wich were then used as conditions in the query.
Now, AFTER I implemented the tutorial everything works perfectly... except one thing.
Well, let me start from the beginning:
In the new versione the parameters are still beying sent from the browse frame to the display frame via request or post and then used locally in the query string. the tutorial also implemented a limit parameter to the query determining the first page and the number of results per page.
The results are split acordingly and the corect number of pages is displayed. It also echoes next, previous and page number links for accessing the other results of the query.
well... these links look something like this:
$page = $pageNum + 1;
$next = " <a href=\"$self?page=$page\">[Next]</a> ";
this basicly tells the page to reload itself and send the new $page variable to the reloadedpage.
When the page reloads there's an if statement at the very top that verifies if the page has been reloaded and has resived a page number:
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
so after the page reloads it will use the new offset variable in the "limit" parameter of the query.
THE PROBLEM IS that when the page reloads all the requested variables from the browse frame are lost and the query will load everything in the database ( just as if there are no conditions set ). Even if I forciblly RE-execute the REQUEST lines to get the variables from the browse frame, the variables just return empty... even though the conditions are still set on the browse frame...
SO my question is... is there no way to send the requestev variables from the browse frame to the reloaded page like we sent the page number?
SOmething like this:
$next = " <a href=\"$self?page=$page?cond1=$cond1?cond2=$cond2...?condx=$condx\">[Next]</a> ";
and then on the page reload check it would be like this?
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
$cond1=$_GET['cond1'];
$cond2=$_GET['cond2'];
...
$condx=$_GET['condx'];
}
Or if there's any other way to transmit multyple variables to a new page... Or maybe just send the WHOLE query string with all the parameters already included as it was executed when the search button was clicked... like this:
$next = " <a href=\"$self?page=$page?sqlstring=$sqlstring\">[Next]</a> ";
and at the page reload check it owuld be like this:
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
$sqlstring=$_GET['sqlstring'];
}
Please help...