Let\'s say I have two databases \'db1\' & \'db2\' on different mysql servers \'A\' & \'B\' respectively.
I want to check every 6 hours if there is any update fou
You could do with with a cron job, simply could run a php file every minute.
this file can check for a new row in a table1 in db2 (saving current count of rows in a text file for comparison, and if new count > old count, then this can then update table1 in db1.
easy
but mysql replication as @Charles said in the comment would be better.
I accepted kutF's answer and after you run that program Using keyword CASCADE in table creation in mysql. So if you update the parent table then the child table also get updated
CREATE TABLE parent
(
par_id INT NOT NULL,
PRIMARY KEY (par_id)
) TYPE = INNODB;
CREATE TABLE child
(
par_id INT NOT NULL,
child_id INT NOT NULL,
PRIMARY KEY (child_id),
FOREIGN KEY (par_id) REFERENCES parent (par_id) ON DELETE CASCADE
) TYPE = INNODB;