0

I am new to MYsql and I have two independent systems that use points(system1) and money(system2).
I need to make it so that column money from bw_money will equal the same as pointshop_data. So that if a change in value will happen in either column it will still be equal to the same amount int he other column. Also this needs to happen at a really fast pace as it is a live item that needs updating on the fly.

(first database) pointshop_data = uniqueud, points
(second database)bw_money=  UID, steamid, money

Make money and points equal to each other.

Leonid Shevtsov
  • 14,024
  • 9
  • 51
  • 82
scarecrow
  • 84
  • 13

1 Answers1

1

You can use triggers to update one column when another changes. Triggers are procedures inside MySQL that are automatically executed on some event, such as, changing the value of a column.

You'll need an AFTER UPDATE trigger for both of the tables to propagate change in both directions.

(Obviously having the value in two places is a requirement, so I'm skipping the lecture on database normalization)

Leonid Shevtsov
  • 14,024
  • 9
  • 51
  • 82