Re: move a record into a different table
| From: | Paul Roberts | Date: | Fri, 31 Jan 2003 22:13:53 +0000 |
| Subject: | Re: move a record into a different table | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133833@lists.php.net to get a copy of this message | ||
so how about
With INSERT ... SELECT statement you can quickly insert many rows into a table from one or many
tables.
INSERT INTO tblTemp2 (fldID) SELECT tblTemp1.fldOrder_ID FROM tblTemp1 WHERE
tblTemp1.fldOrder_ID > 100;
from the mysql manual
Best Wishes
Paul Roberts
mail@paul-roberts.com
++++++++++++++++++++++++
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: <php-general@lists.php.net>
Sent: Friday, January 31, 2003 10:08 PM
Subject: Fw: [PHP] move a record into a different table
Sorry but as convenient as PHP and MySQL are there are some things you just
have to code for yourself. In order to move data from one table to another
you will have to:
1) SELECT the desired fields from the first table
2) extract() them from the results pointer
3) INSERT them into the second table
4) DELETE the originals from the first table
If you need any help with any part of this feel free to ask.
-Kevin
Consider reposting this to the PHP-DB list for further help.
----- Original Message -----
From: "DC" <dcurran@powerup.com.au>
To: <php-general@lists.php.net>
Sent: Friday, January 31, 2003 2:29 PM
Subject: [PHP] move a record into a different table
> Hi all,
>
> I want to delete a record from my table 1, but would like all the data for
> that single record passed onto my (archive) table 2 at the same time....
> Sounds easy!!
>
> Any ideas??
>
> Thanks
>
> DC
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php