Can't add or update child, Foreign Key Error
this message comes of you trying to insert data, that are not exist in the connected tabel

In you case

Your try to insert 12 as county_id_contry which doesn't exist in the table country.

So you have to insert 12 in your country table first, before you add to the state table