Thanx for replying. I have incorporated your suggestion but cant seem to get it working properly: it generates repeating columns of data when i click on the next page. How can I remove the duplicate data?
<?
$page = (!isset($GET['page']))? '0' : $GET['page'];
$country =(!isset($GET['country']))? '0' : $GET['country'];
$gender =(!isset($GET['gender']))? '0' : $GET['gender'];
echo "This is country: $country";
$limit = 10;
$sql_text = "SELECT *
FROM userdetails
WHERE country = '$country'
AND gender = '$gender'
ORDER BY id DESC LIMIT $page,10";
//query one (Get 10 rows)
$myQuery = mysql_query($sql_text);
$myQueryTwo = mysql_query($sql_text);
//$numRows = mysql_num_rows($myQueryTwo);
//echo "<table width='400' border='0' cellspacing='1' cellpadding='1'>";
while ($row = mysql_fetch_assoc($myQuery))
//$picture_path = $row['PICTURE_PATH'];
{
$array[] = $row;
}
$array_chunks = array_chunk($array, 3);
echo "<table border='1'>";
foreach ($array_chunks as $value)
{
echo "<tr>";
foreach ($value as $row)
{
echo("<td><p>\n"
. "<b>Firstname:</b> " . $row["FIRSTNAME"] . "<br />\n"
. "<b>Lastname:</b> " . $row["LASTNAME"] . "<br />\n"
. "<b>Country:</b> Test1" . $row["COUNTRY"] . "<br />\n"
. "<b>contact:</b><hr style=\"color:grey;width:150;text-align:left;\">\n\n\n\n\n</td>");
}
echo "</tr>";
}
echo "</table>";
$page = (!isset($GET['page']))? '0' : $GET['page'];
//Pagination below
$numRows = mysql_num_rows($myQueryTwo);//total rows
if(($page-1) < $numRows && $page != 0) {
//display previous
echo '<a href="MLresultsPageEnd2.php?page='.($page-1).'&country='.$country.'&gender='.$gender.'">Previous</a> ';
}
echo "This is numRows: $numRows";
//get Next link
if($numRows >= $limit){
echo '|<a href="MLresultsPageEnd2.php?page='.($page+1).'&country='.$country.'&gender='.$gender.'">Next</a>';
}
?>