MYSQL Foreign Key not Updating Table -
table 1:
+--------------+-------------+------+-----+---------+----------------+ | field | type | null | key | default | | +--------------+-------------+------+-----+---------+----------------+ | id | int(11) | no | pri | null | auto_increment | | fono | int(11) | no | mul | | | | description | varchar(25) | no | | | | | amount | varchar(60) | no | | | | +--------------+-------------+------+-----+---------+----------------+
table 2:
+--------------+-------------+------+-----+---------+----------------+ | field | type | null | key | default | | +--------------+-------------+------+-----+---------+----------------+ | fono | int(11) | no | pri | null | auto_increment | | finvno | varchar(20) | no | | | | | description | varchar(25) | no | | | | | amount | varchar(60) | no | | | | +--------------+-------------+------+-----+---------+----------------+
i column fono in table 1 automatically value fono column in table 2. have set on update cascades.
although when records being entered fono column in table 1 remains empty.
why happening? can solve this?
thank you.
cascade happen on deleting , update primary key in foreign key defined cascade behavior , not insertion.
on delete cascade on update cascade
just check out more here
Comments
Post a Comment