Jump to content


Photo

MySQL Relation Question


  • Please log in to reply
1 reply to this topic

#1 phporcaffeine

phporcaffeine
  • Members
  • PipPipPip
  • Advanced Member
  • 361 posts
  • LocationOhio, USA

Posted 12 March 2006 - 09:22 PM

I don't know if this REALLY IS a relational issue or not but here is the outline:

2 databases on the same server/host/service instance

First database has a column/field that when changed (UPDATE/INSERT/DELETE) I would like a column/field in the second database to reflect that change as well.

This is an easy-do with PHP I know, thats not what I am looking for though. I'm looking for som SQL magic that just "does-it", if there is such a thing. I was thinking possibly it had to do with relationships but now that I am thinking (scary) maybe a stored proceedure wich would require MySQL 5+.

Any ideas are greatly appreciated.
Thanks,

Ryan Huff
President & Founder, MyCodeTree
support@mycodetree.com | http://mycodetree.com

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 12 March 2006 - 09:49 PM

You could use a procedure, however I would use a trigger...

[a href=\"http://dev.mysql.com/doc/refman/5.1/en/triggers.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.1/en/triggers.html[/a]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users