This topic is locked

Can you copy and paste whole tables?

10/3/2010 6:54:43 PM
PHPRunner General questions
K
karmacomposer author

I have to create three similar tables with subtle differences.
Can I duplicate or copy and paste whole tables with their fields, or do I have to make each one from scratch?
Mike

A
ann 10/4/2010

Mike,
you can copy the table directly in the database.

Here is a sample for MySQL:

CREATE TABLE IF NOT EXISTS NewTableName SELECT * FROM TableName
K
karmacomposer author 10/4/2010



Mike,
you can copy the table directly in the database.

Here is a sample for MySQL:

CREATE TABLE IF NOT EXISTS NewTableName SELECT * FROM TableName



I may not have access to the unix/linux environment. Is there a way to do it in PHPMyAdmin?
Mike

J
jasonfrew 10/4/2010



I may not have access to the unix/linux environment. Is there a way to do it in PHPMyAdmin?
Mike


Assuming that your phpMyAdmin is set-up using the web GUI you would click on the the database your looking to add / copy the tables in

then click on the second tab SQL between structure and search
you will see a box with Run SQL query/queries on database: yourDatabaseName this is where you would put your query

once your happy with the query you click go.
remember take a backup!