Re: [PHP-DB] duplicate a table
Hi, just install phpMyAdmin which has a feature to duplicate tables structure only or structure and data. ""McShen"" [EMAIL PROTECTED] schrieb im Newsbeitrag 9aak89$ruv$[EMAIL PROTECTED]">news:9aak89$ruv$[EMAIL PROTECTED]... how do i duplicate a table? i tried create table refer2 select * from refer; create table refer2 as select * from refer; they didn't work. my mysql version is mysql 3.22.28, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] duplicate a table
I installed mySQLFront and it can do the same thing too through a GUI. You save a *.sql file with or without data. All the Best Lisa -Original Message- From: Johannes Janson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 03, 2001 2:36 PM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] duplicate a table Hi, just install phpMyAdmin which has a feature to duplicate tables structure only or structure and data. ""McShen"" [EMAIL PROTECTED] schrieb im Newsbeitrag 9aak89$ruv$[EMAIL PROTECTED]">news:9aak89$ruv$[EMAIL PROTECTED]... how do i duplicate a table? i tried create table refer2 select * from refer; create table refer2 as select * from refer; they didn't work. my mysql version is mysql 3.22.28, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] duplicate a table
And to go one step further with his question, I would like to know how to do the following: 2 tables named table1 and table2 table1 contains 3 records, firstname, lastname, password. table2 is the same except that it has one more field at the beginning and that field is of type serial. Now, I'd like to quickly select * from from table1 and insert it into table2 but each time issuing a nextval('sequence') on each one to update the sequence numbers for table2. This is because I made a bad design decision and decided I needed to have a numerical identifier for each table entry, but the only way I know to do it now would be to manually insert, or to write a php script to do it. I actually did end up doing the php script, but would like to know how else to do it in the future for anything where I'm trying to take the contents of one table and insert it into another table that has a different structure. Thanks a lot. Peace. -Original Message- From: McShen [mailto:[EMAIL PROTECTED]] Sent: Monday, April 02, 2001 2:47 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] duplicate a table how do i duplicate a table? i tried create table refer2 select * from refer; create table refer2 as select * from refer; they didn't work. my mysql version is mysql 3.22.28, -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]