I have this query, when I echo package_votes I get the number 5, while there actually only is one record!
I totally do not get what is wrong :
PHP:
<?php
$sQuery =
"
SELECT
hosts.id AS iD,
DATE_FORMAT(hosts.date_added,'%Y-%m-%d' ) AS added,
DATE_FORMAT(hosts.date_updated,'%Y-%m-%d' ) AS updated,
hosts.name,
package_main.freehost_id,
package_main.diskstorage,
package_main.bandwidth,
package_main.forcedads,
package_ratings.freehost_id,
uptime_ratings.freehost_id,
overall_ratings.freehost_id,
COUNT(uptime_ratings.freehost_id) AS package_votes
FROM hosts
LEFT JOIN package_main ON hosts.id = package_main.freehost_id
LEFT JOIN package_ratings ON hosts.id = package_ratings.freehost_id
LEFT JOIN uptime_ratings ON hosts.id = uptime_ratings.freehost_id
LEFT JOIN overall_ratings ON hosts.id = overall_ratings.freehost_id
GROUP BY
hosts.id,
hosts.date_added,
hosts.date_updated,
hosts.name,
package_main.freehost_id,
package_main.diskstorage,
package_main.bandwidth,
package_main.forcedads,
package_ratings.freehost_id,
uptime_ratings.freehost_id,
overall_ratings.freehost_id
ORDER BY
date_added DESC LIMIT ".$aNavigatie['iVanaf'].", ".$iMaxPerPagina
;
?>
I totally do not get what is wrong :