0

I am running a LAMP stack. I need to be able to update the values in the column of one table with the values of another column residing on a different table (in the same DB). This needs to be done in real time (or close to it)

Example: table 1: name, age, dob table 2: pname, page, pdob

When values are entered into table one via a form, how do I get them onto the corresponding columns in table 2.

Shadow
  • 33,525
  • 10
  • 51
  • 64
  • 2
    What you're looking for is [a trigger](http://dev.mysql.com/doc/refman/5.7/en/triggers.html) if you can't simply update these two values in tandem. I would strongly advise you do this in your PHP application code before going the trigger way since that leads to enormous complexity if you keep layering those on. This may not be necessary in the first place if you adhere to proper [database normalization](http://en.wikipedia.org/wiki/Database_normalization) principles. – tadman Apr 26 '16 at 02:50
  • dont duplicate data, its bad practice. and phpmyadmin is not a database –  Apr 26 '16 at 02:51
  • Thanks for the input. Any idea how I would go about doing that? I want the most efficent way with the least CPU utilization. ofcourse – noscrodamus Apr 26 '16 at 03:25

0 Answers0