|
Posted by Dejan on 06/09/06 01:07
Sorry for my terreble english.
As i have seen, a previously posted question didn't anwser my problems. So
let's go again.
I have mysql server on local computer. I have mysql server on remote server.
They cann 'see' each other. (Additional comment: I have Apache server on my
local comp too, so i'm gonna run this script using wget and cron), their
connection is my buissnes.
Table on local comp looks like this:
---------------------------------------------
CREATE TABLE `local_comp_table` (
`number` varchar(100) NOT NULL default '0',
`zauzetost` set('0','1') default '0',
`id` bigint(6) NOT NULL auto_increment,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
---------------------------------------------
Table on remote server looks like this:
---------------------------------------------
CREATE TABLE `remote_server_table` (
`id` varchar(25) NOT NULL default '0',
`Prezime` varchar(100) NOT NULL default '',
`Ime` varchar(100) NOT NULL default '',
`number` varchar(100) default NULL,
`zauzetost` set('0','1') default '0',
PRIMARY KEY (`id`)
) TYPE=MyISAM;
---------------------------------------------
I need script that is going to select all the record's from local, then
compare it with remote (using number field). Finding same field data
(number) in both tables is esential.
When script finds a same number in both tables she need's to change remote
server table field 'zauzetost' with data from 'zauzetost' on local table.
---------------------------------------------
Example:
I have local table like this:
number | zauzetost | id
-----------------------------
12345 | 0 | 18
45678 | 1 | 19
I have remote table like this:
id | Prezime | Ime | number | zauzetost |
-------------------------------------------------
210 | Doe | John | 89745 | 1 | -----> no match
897 | Gates | Bill | 56712 | 0 | -----> no match
256 | Doe | Jenny | 12345 | 1 | -----> match number in
local and remote, and now 'zauzetost' neads to be changed into '0' on
remote, becouse on local 'zauzetost' is '0' for that record.
Tnx in advance on your brain cells, and anwsers.
Dejan
Navigation:
[Reply to this message]
|