GROUP_CONCAT with different SEPARATOR in laravel ExampleBy Hardik Savani | January 20, 2016 | | 2944 Viewer | Category : Laravel MySql
Share this post:
Whenever, you need to use GROUP_CONCAT with differente separator(I mean default separator is ',', But you want to change '@','#','&' etc as you want). then you have to use use SEPARATOR keyword in GROUP_CONCAT(). If you are working on laravel then you have to also use DB::raw() for write GROUP_CONCAT() inside the this function.
So, Basically how to change seprator in group_concat(), In following example i change ',' separator into '@'.you can use the following example how to use in laravel 4 and 5.
$items = DB::table('items')
,DB::raw("(GROUP_CONCAT(items_city.name SEPARATOR '@')) as `cities`"))
- PHP - multiple file uploading dropzone js example
- Ajax Image Upload Example with Validation in PHP Laravel Framework
- Ckeditor required field validation example in Jquery
- How to check if file exists or not in Laravel 5?
- Laravel 5 amazon s3 file upload tutorial - Part 2
- Laravel 5 - Paypal Payment Integration example using netshell/paypal package from scratch
- Jquery highlight search text in div using highlight JS with example
- Bootstrap progress bar animate example using bootstrap-progressbar.js