RE: [PHP] Move data from one MySql table to another?
| From: | PHPBeginner.com | Date: | Fri, 23 Mar 2001 16:16:18 +0000 |
| Subject: | RE: [PHP] Move data from one MySql table to another? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45307@lists.php.net to get a copy of this message | ||
Oh yeah, at my work I do it all the time,
the simplest way is to create a small function which will:
$SQL = "SELECT * FROM table WHERE ID=$id";
and then (whatever method you use) catch that array and call some
function moveMe($array='') {
if(!is_array($array) or $array=='')
Return False;
/// Loop this array creating a query like:
/// Prepare the array in this format:
/// $staff[] = "this='that'";
/// $staff[] = "that='this'";
/// $SQL = 'INSERT INTO table2 SET '.implode(',', $staff);
/// And vua la! insert it !
}
hope this was of some help to you,
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: YoBro [mailto:nospam@brochures.co.nz]
Sent: Friday, March 23, 2001 8:31 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Move data from one MySql table to another?
I need to know how to do it in PHP?
""Cal Evans"" <cal@calevans.com> wrote in message
news:NABBLCCEONHNHBGBBPHPIEABAMAB.cal@calevans.com...
: Probably on the MySQL list. This is the PHP. (This is arguments,abuse is
: down the hall.)
:
: Try:
: http://www.mysql.com/documentation/lists.html
:
:
: Cal
: http://www.calevans.com
:
:
: -----Original Message-----
: From: YoBro [mailto:nospam@brochures.co.nz]
: Sent: Thursday, March 22, 2001 5:20 PM
: To: php-general@lists.php.net
: 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: php-general-unsubscribe@lists.php.net
: For additional commands, e-mail: php-general-help@lists.php.net
: To contact the list administrators, e-mail: php-list-admin@lists.php.net
:
:
:
: --
: PHP General Mailing List (http://www.php.net/)
: To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
: For additional commands, e-mail: php-general-help@lists.php.net
: To contact the list administrators, e-mail: php-list-admin@lists.php.net
:
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net