Tag : DATE_SUB


How to get current month data in MySql PHP ?

If you require to get all the records of current month using mysql query. for example you have one table "items" and columns are id, title, description, created_at and update_at, Now you want to get all records of this month. so you can fetch fields value using DATE_SUB and INTERVAL of mysql. In following example you can see how to select data of current month. <strong class="example">Example:</strong> <pre class="language-mysql">SELECT * FROM items WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 MONTH);</pre>

By Hardik Savani | March 17, 2016 | | 3005 Viewer | Category : PHP MySql
READ MORE

    Laravel 5 import export to excel and csv using maatwebsite example.

    Laravel 5 import export to excel and csv using maatwebsite example.

    Open Post

    PHP - Bootstrap autocomplete tokenfield with Ajax Example

    PHP - Bootstrap autocomplete tokenfield with Ajax Example

    Open Post

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Open Post

    Laravel 5.3 - Customize pagination templates example from scratch

    Laravel 5.3 - Customize pagination templates example from scratch

    Open Post

    How to add charts in Laravel 5 using Chart JS ?

    How to add charts in Laravel 5 using Chart JS ?

    Open Post

    Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.

    Laravel 5.2 and AngularJS CRUD with Search and Pagination Example.

    Open Post