im geting this error when trying to do 2 counts inside of my query
first ill show you the query:
$sql = mysql_query("select c.id, c.number, d.name,
(select count(*) from `parts` where `id_container`=c.id group by `id_car`) as packcount,
(select count(*) from `parts` where `id_container`=c.id) as partcount
from `containers` as c
left join `destinations` as d on (d.id = c.id_destination)
order by c.number asc") or die(mysql_error());
now the parts
table has 2 fields that i need to use in the count:
id_car
id_container
id_car
= the ID of the car the part is for
id_container
= the ID of the container the part is in
for packcount
all i want is a count of the total cars per container
for partcount
all i want it a count of the total parts per container