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 | | 1093 Viewer | Category : Laravel
READ MORE

    Laravel 5 client side validation using Parsley.js example

    Laravel 5 client side validation using Parsley.js example

    Open Post

    AngularJS - convert comma separated string to array example

    AngularJS - convert comma separated string to array example

    Open Post

    AngularJS - Display Default image if original image does not exists with example

    AngularJS - Display Default image if original image does not exists with example

    Open Post

    Response download with file in Laravel 5.3 example

    Response download with file in Laravel 5.3 example

    Open Post

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Laravel 5.3 - Create Bootstrap Contact US Form using Form Request

    Open Post

    How to get last record from MySQL table in Codeigniter?

    How to get last record from MySQL table in Codeigniter?

    Open Post