PDA

View Full Version : what to do to copy[triple] a table['land' to 'villas' to 'apts'] in phpmyadmin


lse123
11-20-2007, 10:10 PM
what to do to copy[triple] a table['land' to 'villas' to 'apts'] in phpmyadmin, not the contains ?

CREATE TABLE `land` (
`photourl` VARCHAR( 40 ) NULL ,
`id` VARCHAR( 5 ) NOT NULL ,
`name` VARCHAR( 40 ) NOT NULL ,
`priceeuro` DECIMAL( 9, 2 ) NULL ,
`pricecyp` DECIMAL( 9, 2 ) NULL ,
`beds` VARCHAR( 1 ) NULL ,
`description` VARCHAR( 500 ) NULL ,
`location` VARCHAR( 20 ) NULL ,
`area` VARCHAR( 20 ) NULL ,
`detailsurl` VARCHAR( 40 ) NULL
) ENGINE = MYISAM COMMENT = 'Land for sale in Pafos';

mic2100
11-20-2007, 10:33 PM
you will have to go to select the table and go to the operations page this will allow you to copy the table to a different db/table name.

guelphdad
11-21-2007, 07:40 PM
Use the tab marked SQL you can do anything in phpmyadmin when you use that tab without having to resort to clicking, pointing etc. Sometimes that tab is very useful. For instance you merely need to do:

CREATE TABLE villas LIKE land

however you should not be creating three tables that are essentially the same. Good database normalization suggests that you create a column in the land table to denote land, villas, apts for example and then you only have to use the one table.