Reply to Re: Mysql data copy HELP

Your name:

Reply:


Posted by Mike Youell on 10/13/43 11:44

Hi Dejan,

Try this:

HOST SCRIPT
1) create a script called get_insert_keys.php which does a "select
broj_tel from table2" and outputs all the values using the php echo
function.

LOCAL SCRIPT
1) create a script on your local machine which does a
file_get_contents("http://www.yourdomain.com/cgi-bin/get_insert_keys.php?username=fred&password=blahblah");
and reads the broj_tel values into an array. (one-way encrypt password
before sending like this!)

2) Now you have a list of broj_tel's from table 2 (but on your local
machine). Now create a CSV file of all the fields in table1 that have
a broj_tel from table2 (see the array for broj_tel's from table2).

3) Now use the php ftp functions to copy this CSV data file to your
host to a designated directory, e.g. /data/ or whatever.

4) Then use
file_get_contents("http://www.yourdomain.com/cgi-bin/insert_values_from_table1.php?username=fred&password=blahblah");
to call a script on the host to insert the values using the new CSV
datafile.

This may seem complicated (it's actually quite easy to implement) but
at least it can be automated easily without the use of phpmyadmin etc.
You could also gzip the data before sending.

Note that you run the local script to trigger everything off. It is
that script which drives the whole thing.

There's probably a much easier way to do this. If this is the case
then someone please tell me too :o)

Cheers,
Mike Youell.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация