HI I have a PHP Pagination system, what i am trying to do is use Distinct to return only unique values, what happens is the page shows how many pages there should be but doesn't give me any results.
My code is here
$query = "SELECT DISTINCT ip_address,
COUNT(*) as num
FROM $tableName
WHERE hostname
LIKE 'mail%' AND type='6'";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
$stages = 3;
$page = mysql_escape_string($_GET['page']);
if($page){
$start = ($page - 1) * $limit;
}else{
$start = 0;
}
// Get page data
$query1 = "SELECT DISTINCT ip_address,
hostname
FROM masterip_details
WHERE hostname
LIKE 'mail%' AND type='6'
LIMIT $start, $limit";
$result = mysql_query($query1);