Lid |
|
Maar ze zitten in dezelfde tabel?? dan kun je toch simpel samennemen? Ik heb dit gedaan, heb het natuurlijk niet kunnen testen, want ik heb je tabellen niet.
$sql = mysql_query("SELECT `al_id`, `al_name`, `al_image`, COUNT(`im_album_id`) AS `al_numipage`, COUNT(`im_album_id_pano`) as `im_numimagapano`
FROM `tbl_album al` LEFT JOIN `tbl_pano im` ON `al`.`al_id` = `im`.`im_album_id_pano` GROUP BY `al_id` ORDER BY `al_name` LIMIT '".$offset."', '".$albumPerPage."'") or die ("Databasefout: ".mysql_error());
$sql = mysql_query("SELECT `al_id`, `al_name`, `al_image`, COUNT(`im_album_id`) AS `al_numipage`, COUNT(`im_album_id_pano`) as `im_numimagapano` FROM `tbl_album al` LEFT JOIN `tbl_pano im` ON `al`.`al_id` = `im`.`im_album_id_pano` GROUP BY `al_id` ORDER BY `al_name` LIMIT '".$offset."', '".$albumPerPage."'") or die ("Databasefout: ".mysql_error());
|