RE: [PHP] Best way to automatically get mySQL database.
| From: | Jay Blanchard | Date: | Thu, 11 Oct 2007 12:40:01 +0000 |
| Subject: | RE: [PHP] Best way to automatically get mySQL database. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263092@lists.php.net to get a copy of this message | ||
[snip]
We've got a local system (PHP intranet) and we need to connect to a live
mySQL server get some of the tables (contents) and overwrite the same
tables in the local mySQL database. This needs to be done with PHP.
Im wondering the best to do this.
Is it to get all the information into result sets for each table and
then delete the contents of each local table and then looping through
the result sets just insert the information into the local tables? This
seems like a good solution but I wonder if there are any out there
before going ahead with development.
[/snip]
TRUNCATE local_table;
SELECT remote_stuff INTO local_table;