Could anyone please show me how to update a dataValue each time a data in another database changes its value ?

Here is a screenshot of my 2 databases I would like that;

Each time a value in database1-table1 is changing,
It sends a trigger to change the age value in database2-useragetable

enter image description here

I attempt to create a trigger from this link. Using Trigger to update table in another database
And Here is the code and the screenshot of it.

    AFTER UPDATE ON table1.value  FOR EACH ROW
    UPDATE TABLE database2.useragetable
    SET  age = NEW.value

    WHERE no = NEW.no

enter image description here

1 Answers

Nishita On

Please refer to the following wiki to create a trigger:


  1. In phpMyAdmin, select the database (database1-table1) that you want to work with.

  2. Go to the SQL tab at the top of the page.

  3. In the "Run SQL query/queries on database" form, change the Delimiter to $$. (Located in a small box at the bottom of the form)
  4. Enter your SQL trigger into the main dialog box on the form.