0
I’m making these two queries to download the colors and the amount of each color in the table bike
:
SELECT DISTINCT color FROM bike ORDER BY color ASC
SELECT COUNT(color) FROM bike GROUP BY color ORDER BY color ASC
As I do so in the second query, counts also come with the name of the associated color, in an array only?
Which database are you using? Sqlite? Mysql? Postgresql? SQL Server? Oracle? DB2?
– user25930
You can give an example of a table
bike
, with content, and explain the object you wanted to get into your PHP code?– user25930
mysql, bike has various information and a 10 columns and the column I want and color, I need to return everything in 1 array, I will put what returns.
– Léo Soares Fontoura
Because your first consultation doesn’t solve your problem?
– user25930
because I need to use both in a foreach displaying like this, color(Qtd)
– Léo Soares Fontoura