Guys you are trying to insert data from one of your existing table to another existing table or same table in mysql you can use SQL Insert into Select Query. The following query will explain

INSERT INTO users (user_id,username,email,password)
SELECT user_id,username,email,password FROM users;

You can add where clause too,

INSERT INTO users (user_id,username,email,password)
SELECT user_id,username,email,password FROM users
Where user_id <= 5;

 

Share Your Thoughts

0 Comments
Inline Feedbacks
View all comments
Subscribe Our Channel

Email Subscription
Watch Tutorials
Loading
Copyright © 2015 - 2021 PHPEXPERTISE.COM