Welcome Guest, Not a member yet? Register   Sign In
MYSQL Shows the amount of leads for each day --- help
#1

[eluser]Atrhick[/eluser]
I need some help please. I am trying to show how many lead CIQFY sold on any given date but my MySQL skill are still lacking.

Here is my code:

Code:
$query_str1 = "SELECT date_day, afid_seller_name, COUNT(afid_seller_name) "
                      . " FROM lead_partners_pages "
                      . " WHERE afid_seller_name = 'CIQFY' AND MONTH(date_day)=MONTH(NOW()) "
                      . " GROUP BY date_day ";

+------------+--------------+-------------+
| date_day | afid_seller_name| total_price |
+------------+--------------+-------------+
| 2011-12-22 | CIQFY | 1.50 |
| 2011-12-22 | CIQFY | 1.50 |
| 2011-12-21 | CIQFY | 1.50 |
| 2011-12-21 | HKFEY | 2.00 |
| 2011-12-20 | CIQFY | 2.00 |
| 2011-12-20 | HKFEY | 3.00 |
| 2011-12-20 | CIQFY | 3.00 |
| 2011-12-20 | CIQFY | 3.00 |
+------------+--------------+-------------+

Here is what I want the result to look like. I know how to use php to format it.

22. 2
21. 1
20. 3




Theme © iAndrew 2016 - Forum software by © MyBB