Technically, that would be a COPY. The original data would still be there.
To do a MOVE he would need to issue a delete in old_table after confirming
that the insert into new_table succeeded.
HTH,
Cal
http://www.calevans.com
-----Original Message-----
From: James Atkinson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 22, 2001 5:26 PM
To: YoBro
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Move data from one MySql table to another?
OK say you old table is this
create table old_table (
id int auto_increment,
name varchar(100),
address varchar(200),
comments text);
and you new table is:
create table new_table (
id int auto_increment,
name varchar(200),
address varchar(200));
To populate new_table from old_table you can give it this SQL:
INSERT INTO new_table (name, address) VALUES SELECT name, address FROM
old_table;
Hope that helps
- James
> -----Original Message-----
> From: YoBro [mailto:[EMAIL PROTECTED]]
> Sent: March 22, 2001 3:20 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Move data from one MySql table to another?
>
>
> Hello,
>
> Does anybody know where I could find out how to Move data from one Mysql
> table to another.
>
> I have a query showing all the results, and I am trying to put a
> link at the
> end of each row that says "move"
>
> Clicking this will move that records information to another table.
> IE From table orders to table ordered
>
> Make sense?
>
> Please help
>
> --
> Regards,
>
>
> YoBro
> -------------------------------------------------------------
> DO NOT REPLY TO THIS VIA EMAIL
> PLEASE USE THE NEWSGROUP
> All emails sent to this address are automatically deleted.
> This is to avoid SPAM!
> -------------------------------------------------------------
>
>
>
> --
> PHP General 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 General 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 General 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]