MySQL


Laravel select with count(*) using db raw example

Hi Guys, In this small article. i will let you know how to use select with count aggregate and group by using db raw in Laravel application. Here i gave you simple query example for join with count(*) as aggregate in select statement, i convert it into laravel db query builder. If you want to use count aggregate function in select statement then you require to use db::raw in eloquent select func.....

Posted On January 2, 2018

MySQL Query - How to select records of today to next Sunday ?

In this tutorial, i will let you know how to get records of today to weekend by using mysql query. This is MySQL Query that you can easily use in your core PHP and PHP framework like Laravel, Codeigniter, cakephp etc project. If you require to get records this way, today is Tuesday and you need to get data from today to next Sunday that means Tuesday to Sunday. sometimes we require to fetch recor.....

Posted On December 18, 2017

MySQL - select first word from string using SUBSTR

In this small article, i would like to share with you how to extract the first word of string in sql query. i did that using SUBSTR, LOCATE and If statement. Yesterday, i was working on my laravel project and i require to get first name from fulname column like as example: "Hardik Savani" Hardik Savani is a full name but i just need to get first work "Hardik" from fullname of users table in phpm.....

Posted On December 2, 2017