You are here: Re: sql+php help « PHP SQL « IT news, forums, messages
Re: sql+php help

Posted by J.O. Aho on 10/04/54 11:52

Dejan wrote:
> hy
>
> I have two mysql servers. One is on my local comp (localhost) and the other
> is something.com
> Creating simple php script to do this...
>
> ----------------------------------------------------------------------
> $db1 = mysql_connect("something.com", "username", "pass") or die("Could not
> connect.");
> if(!$db1)
> die("no db");
> if(!mysql_select_db("smjestaj",$db1)) die("No database selected.");
>
>
> $db2 = mysql_connect("localhost", "username", "pass") or die("Could not
> connect.");
> if(!$db2)
> die("no db");
> if(!mysql_select_db("smjestaj",$db2)) die("No database selected.");
>
> ----------------------------------------------------------------------
>
> i nead to execute this query on my local comp's web server.
>
> update table2
> set zauzetost = t1.zauzetost
> from table2 t2, table1 t1
> where t2.id = t1.id
>
>
> table2 is on remote server, table1 is on local comp.
> How to do this? I'm poor coder, so...

You query table1 and table2 and store those in two multi dimensional arrays,
then you create your third multi dimensional array into where you store the
joint rows of table1 and table2.


//Aho

 

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

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