How to extract MySQL data monthwise and daywise to populate table to draw graph using PHP libchart? -
I have a table that has call_id, timestamp, date, firstname, last_name, status and so on. < / P>
What do I need to do to draw the graph by data, filtered according to their dates. This is for month-to-date graphs, I need to position = accept the number of rows that are approved for each day of the month according to the current date.
And, for the year-to-date article
My idea of doing this is -
For months-to-to-time, Date:
$ temp = date ("Ym-"); While ($ i & lt; = Date ("D")) {$ query = "Main WHERE Status =" Approved "and Call = '". $ Temp $ I. Select from "" "call_id; $ result = mysql_query ($ query, $ link) or die (" ", mysql_error ()); $ count [i] = mysql_num_rows ($ result);} And then I was thinking of pursuing these meanings in the array in the other temporary tables (YTD for one and one for MTD) by a "floating" loop and then Drawing articles from those tables using PHP Libertarch
Is there a better way to do this? Or is this the only way?
You can make it very easy to get rid of it using mysql and lots of your Php loops such as for the month date:
$ query = "Select COUNT (call_id) as 'num_records', from the main WHERE state, date = 'approved' and concrete (year) , Date (date)) = CONCAT (year (now ()), date by date (now ()) group This query will show a row that date and total records on that day For every day For Heine.
Comments
Post a Comment