You are here: Re: Mysql data copy HELP « All PHP « IT news, forums, messages
Re: Mysql data copy HELP

Posted by Dejan on 04/10/06 01:27

Too hard.
I'm gonna think abaout it, any try it.
tnx on advice.


Mike Youell <mike@youell.net> wrote in message
news:1144504342.911875.17750@e56g2000cwe.googlegroups.com...
>
> 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?use
rname=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_tabl
e1.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.
>

 

Navigation:

[Reply to this 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

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