enter image description here No matter how I set up ON UPDATE and ON DELETE when joining tables, it’s all the same when adding data to the table add_photos_store through the admin panel, such an error "

Cannot add or update a row to a foreign key constraint fails ( freeman_domolux . add_photos_store , CONSTRAINT add_photos_store_ibfk_1 FOREIGN KEY ( magazin_id )

"I translate this." It is impossible to add or update a child line: the foreign key restriction is not executed. "I did not set a restriction, why such an error? in each store, this is because of the sample. You need to write a sample so select * from add_photos_store where magazin_id = n, where n is the store id, eg magazin_id = id, but this error "Unknown column 'magazin_id' in 'where clause'". What is wrong doing?

  • on delete is executed on delete, on update, respectively, on changing. But when inserting data in the parent table, there must be an entry referenced by the child being inserted. Before inserting a child record, make sure that you enter in the field such an ID that already exists in the parent - Mike
  • and why it doesn’t find a column to tell if it’s a mistake in one letter or maybe the structure of the table is different from what is in the picture - Mike
  • I will look , here dropmefiles.com/jtivv DB can she will help with the answer. - Arthur Chereshnyuk
  • To write to the child, you need to create a store, otherwise the button will not appear, so I add to the child when the parent is created. - Arthur Chereshnyuk
  • Well on this database, the query select * from add_photos_store where magazin_id=1 completes without errors. so that somewhere you are looking at it, maybe phpmyadmin or through what you execute the query connects to some other database - Mike

0