Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

php mysql select current month

mysql> select * from sales
       where MONTH(order_date)=MONTH(now())
       and YEAR(order_date)=YEAR(now());
+------------+------+--------+
| order_date | sale | orders |
+------------+------+--------+
| 2020-05-01 |  250 |     14 |
| 2020-05-02 |  150 |     20 |
| 2020-05-03 |  300 |     21 |
| 2020-05-04 |  200 |     15 |
| 2020-05-05 |  200 |     17 |
| 2020-05-06 |  250 |     12 |
| 2020-05-07 |  150 |     15 |
| 2020-05-08 |  300 |     12 |
| 2020-05-09 |  200 |     18 |
+------------+------+--------+
Source by ubiq.co #
 
PREVIOUS NEXT
Tagged: #php #mysql #select #current #month
ADD COMMENT
Topic
Name
2+4 =