I am trying to link fields between 2 of my tables but its not working.
I have a table called assets, which consists of Asset_ID and AssetType
and a table called t5_week3_shift3 which also consists of these 2 plus others.
Im not sure whether to do away with the assets table and just have both fields in the t5_week3_shift3 table, but i have recently created the t5_week3_shift3 table and i have all asset_ID's in this table which are also in assets table but i need to asset types in this table too which relate to each asset_ID.
whats the easiest way to do this, i thought i could somehow link the two tables but it doesnt work.
if i index AssetType in assets table and try to set up a relationship to assetType in t5_week3_shift3 table i get this error:
#1452 - Cannot add or update a child row: a foreign key constraint fails (`chs`.`#sql-9b0_59`, CONSTRAINT `#sql-9b0_59_ibfk_1` FOREIGN KEY (`AssetType`) REFERENCES `t5_week3_shift3` (`AssetType`))