RE: [PHP-DB] Copy data from one mysql table to another?

From: Date: Wed, 28 Mar 2001 21:24:40 +0000
Subject: RE: [PHP-DB] Copy data from one mysql table to another?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7947@lists.php.net to get a copy of this message
do something like - 1. make a third table indentical to table svt_members. lets call it svt_members_temp. 2. load the svt_members_temp table with the merged values. "Insert into svt_members_temp(key_svt_members, phone, etc,etc,etc) Select phone.key_svt_members, phone.phone, svt_members.etc, svt_members.etc, svt_members.etc >From svt_members, phone Where svt_members.key_svt_members = phone.key_svt_members" 3. cross your fingers (or backup) 4. empty the contents of the original table. "delete from svt_members" 5. load the data back into the real table. "Insert into svt_members(key_svt_members, phone, etc,etc,etc) Select svt_members_temp(key_svt_members, phone, etc,etc,etc)" - brian hardwick -----Original Message----- From: Bob Stone [mailto:bstone98@yahoo.com] Sent: Wednesday, March 28, 2001 3:54 PM To: php-db@lists.php.net Subject: [PHP-DB] Copy data from one mysql table to another? Dear PHP Helpers, I cannot find any documentation on how to copy the data from one mysql table to another, i.e. table1, columnx to table2, columnx. Can you recommend a way? Here is the situation. I have one table called "phone" with two columns. The first column is called "key_svt_members," the second is called "phone." I have a second table called "svt_members." This table has 17 columns including "key_svt_members" and "phone." The phone column in this table is currently empty. I wish to copy the data that is in phone, phone into svt_members. Can you recommend a method? Thanks in advance, Bob Stone __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/?.refer=text -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#7947) next »