I have made a sql query to fetch how many values exists for each color. This is the query:
$sql = "SELECT Color, count(Color) as Total FROM table WHERE (Color !='Red' AND Color !='White' AND Color !='Blu') GROUP BY Color ORDER By Total DESC";
This is the output of the query:
+--------+-------+ | Color | Total | +--------+-------+ | Orange | 2471 | | Yellow | 337 | | Black | 82 | +--------+-------+
Well now I would like to print in PHP the "Total" value "IF" the Color is Orange, or Yellow, etc...
Example: if Color=Orange I should see "2471" if Color=Yellow I should see "337" etc...
Thanks!