lonerunner
lonerunner

Reputation: 1322

Importing mysql data from one table to another

It's very simple to someone but looks like complicated to me. I have 2 tables, one is called jos_users other is called jvdb_users. Tables are exact same, both containing user informations such as user email, password, name, etc. Only table one have many users, table two is empty, i need to transfer all fields and data from table one to table two. How do i do that with phpmyadmin and mysql on linux server.

Upvotes: 5

Views: 15833

Answers (2)

webNeat
webNeat

Reputation: 2828

try this :

INSERT INTO table1 VALUES (SELECT * FROM table2);

Upvotes: 2

Ibu
Ibu

Reputation: 43810

if they both have the same columns you can use this command

INSERT INTO `tabletwo` (SELECT * FROM tableone)

You can write this in the SQL section of phpmyadmin

Upvotes: 12

Related Questions