Shadowing Posted December 5, 2011 Share Posted December 5, 2011 Is it possible to have two tables sharing the same column. where if I update column in one table it will auto update the same column in the other table with the same value Quote Link to comment Share on other sites More sharing options...
trq Posted December 5, 2011 Share Posted December 5, 2011 It is poor design to have duplicate data stored in your database. Quote Link to comment Share on other sites More sharing options...
Shadowing Posted December 5, 2011 Author Share Posted December 5, 2011 I wanted to do it for organize reasons I guess im making a web browser game the only table I have right now is users so wanted to create another table so game stuff isnt mixed in with non game related stuff. So the only column i wanted to share was user id between the two tables. but i guess there is other ways of doing this. when someoen registers have it create a id for the other table that equals the same id on the other table guess that would work Quote Link to comment Share on other sites More sharing options...
awjudd Posted December 5, 2011 Share Posted December 5, 2011 To do what you are wanting, have a FOREIGN KEY on your secondary table which relates to the first table's PRIMARY KEY and then mark it as on UPDATE CASCADE. Not sure why you are splitting this out, but yeah. ~awjudd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.