Hi,
I’ve got to use multiple counts in php. Now I do it like this:
[php]$res5 = mysql_query(“SELECT count(cars) FROM mytable
WHERE car=‘bmw’ and cars!=’’”) or die(mysql_error());
list($bmws)=mysql_fetch_row($res5);
$res6 = mysql_query(“SELECT count(boats) FROM mytable
WHERE boat=‘bavaria’ and boats!=’’”) or die(mysql_error());
list($boats)=mysql_fetch_row($res6);
$res7 = mysql_query(“SELECT count(motos) FROM mytable
WHERE moto=‘suzuki’ and moto!=’’”) or die(mysql_error());
list($motos)=mysql_fetch_row($res7);
[/php]
They fields are all in the same table. Is there a way to have on select instead of three?
I would appreciate your help.
Thanks in advance