How to copy one table data into another table using Mysql Query?By Hardik Savani | January 30, 2016 | | 1199 Viewer | Category : PHP MySql
Share this post:
If you are working on php or any php framwork and you want to copy one table into other table by using sql query, so you could do it using simple SELECT and INSERT statement. just you need to think how you can use.
In Following example you can see how to fetch data from "post" table and how to insert into "post_copy" table, so basically you have to select field of one that you want to copy and second one give name of table with proper field that you want insert. But don't forgot to give a name of field otherwise it generate error.
INSERT INTO `post_copy` (name,slug,status)
SELECT name,slug,'1' FROM `post`
- Select box with search option example in Jquery using Chosen Plugin
- How to check file size when select multiple file validation using Jquery?
- How to increase throttle lockout time and max Login Attempts in Laravel 5?
- Laravel 5.2 multi auth example using Auth guard from scratch
- How to implement lazy loading image with example for your website?
- How to get site URL in Laravel 5?
- Laravel 5 client side validation using Parsley.js example
- Pixel tracking code php example