When a search is performed on any query in my database the results show correctly to page limit and new offset, except when searching "country". It shows the first page correctly and the next page does not show newoffset, it shows entire content of "country"
Please can someone tell me where I have gone wrong and what I need to change
Many thanks
Sammylee
if (isset($country))
{
$sql.="and country='$country' ";
$comanda.="&country=$country&country=1";
}
else
{
$country=" ";
}
<tr>
<td><?echo $country_text?></td>
<td><select name="country" id="country">
<?
for ($i=0;$i<count($country_array);$i++)
{
if ($i==0)
{
?>
<option selected><?echo
$country_array[$i]?></option>
<?
}
else
{
?>
<option><?echo
$country_array[$i]?></option>
<?
}
}
?>
</select> <input name="country" type="checkbox" id="country" value="1">
<?=$check_if_you_want?>
</td>
</tr>[/COLOR]
<?
if (isset($Submit)){
$result2 = mysql_query($sql2) or die(mysql_error());
$totrows = mysql_numrows($result2);
if($totrows>0)
{
if ($offset!=1)
{
$prevoffset>=($offset-$page_limit);
echo("<font face=Verdana,Arial,Helvetica, sans-serif size=2 color=white><a href=$PHP_SELF$comanda&offset=$prevoffset>$inapoi</a></font>");
}
// Calculate total number of pages in result
$pages=intval($totrows/$page_limit);
// $pages now contains total number of pages needed unless there is a remainder from division
if ($totrows%$page_limit) {
// has remainder so add one page
$pages++;
}
?>
<?php
// Check to see if current page is last page
if (!((($offset+$page_limit)/$page_limit)==$pages) && $pages!=1) {
// Not on the last page yet, so display a NEXT Link
$newoffset=$offset+$page_limit;
?>
<font face=verdana size=2 color=black><a href=<?php echo($PHP_SELF.$comanda."&offset=$newoffset");?>><?php echo($urmatoarele);?></a></font>[/COLOR]