I am running this query:
$q2 = "
SELECT
cam_systems.id,
GROUP_CONCAT(system_disks.system_disks_qty) AS system_disks_qty,
GROUP_CONCAT(system_disks.system_disks_make) AS system_disks_make,
GROUP_CONCAT(system_disks.system_disks_model_no) AS system_disks_model_no,
GROUP_CONCAT(system_disks.system_disks_size) AS system_disks_size,
GROUP_CONCAT(system_memory.system_memory_qty) AS system_memory_qty,
GROUP_CONCAT(system_memory.system_memory_serial_no) AS system_memory_serial_no,
GROUP_CONCAT(system_memory.system_memory_manf) AS system_memory_manf,
GROUP_CONCAT(system_memory.system_memory_part_no) AS system_memory_part_no,
GROUP_CONCAT(system_memory.system_memory_size) AS system_memory_size
FROM
cam_systems,
system_disks,
system_memory
WHERE
cam_systems.location_id = '1'
AND system_disks.system_id = cam_systems.id
AND system_memory.system_id = cam_systems.id
GROUP BY
cam_systems.id LIMIT 0,10";
It almost works, but the problem I am running into is sometimes say a system has 2 different disks, therefore the group concat will group a field like system_disks_qty and it will show as :
2,4 as in it has 6 hard drives 2 of one type and 4 of the other. That's all good, the problem is say in system_memory, I only have one type, say 8 sticks of one type. The quantity shows up as 8,8. Its repeating the same value since it had to loop twice for the disks.
Below is what it is outputting. the first row is correct. The second and third are not. The disk info displays correctly, but the memory does not. It is showing the same result twice.

Anyone have a suggestion?