Return an array from query php

0

Good morning, I'm starting with php and I have the following doubt I'm populating a graph that is of the MONTHLY requests, in js

The way to save it is as follows:

                       ...
                       pointHighlightFill: "#fff",
                       pointHighlightStroke: "rgba(220,220,220,1)",
                       data: [12,11,10,9,8,7,8,8,5,5,3,4] //AQUI POPULA
               },

I have the following query in the database:

select COUNT(SolID) total from Solicitacao where 
UsuIDGrupoRespConclusao = 2655
AND DATEPART(yyyy, SolData) = DATEPART(yyyy, DATEADD(m, 0, getdate()))
group by MONTH(soldata)

This query queries ALL ANNUAL requests, it will return 11 rows, the first one for the month of January, the second February, and so on.

How do I pro my PHP query in the database and store this return (only one query) within 12 variables, and so I fill in this chart?

    
asked by anonymous 05.11.2015 / 11:26

1 answer

1

$suaArray = array('12','11','10','9','8','7','8','8','5','5','3','4');
$suaString = implode(",", $suaArray);
    
05.11.2015 / 12:15