Tag : DB Statement


How to execute mysql query in laravel?

Sometimes, we require to run directly mysql query on Laravel for example if you need to copy one table to other table using mysql query. I also need in one project and that's why i am fetching problem. But you can use sql query on laravel using db statement in bellow example you can learn how to run. <strong>Example:</strong> <pre class="prettyprint lang-php"> DB::statement(" INSERT INTO `posts` (repost_of_id,token_id,post_details,user) SELECT id,token_id,post_details,".$loginUserId." FROM `posts` where id = ".$postId." "); </pre>

By Hardik Savani | May 2, 2016 | | 1739 Viewer | Category : Laravel
READ MORE

    Laravel 5 export to pdf using maatwebsite example

    Laravel 5 export to pdf using maatwebsite example

    Open Post

    Bootstrap - Jquery multiple select with checkboxes example using bootstrap-multiselect.js plugin

    Bootstrap - Jquery multiple select with checkboxes example using bootstrap-multiselect.js plugin

    Open Post

    Multi select autocomplete jquery example with code

    Multi select autocomplete jquery example with code

    Open Post

    How to add custom jquery validation for image file upload in summernote ?

    How to add custom jquery validation for image file upload in summernote ?

    Open Post

    How to get keys name from array using array helper in PHP Laravel ?

    How to get keys name from array using array helper in PHP Laravel ?

    Open Post

    Laravel 5.3 - Customize pagination templates example from scratch

    Laravel 5.3 - Customize pagination templates example from scratch

    Open Post