php - Creating foreign key in phpmyadmin mysql -
creating comment system simple rating system each comment.
tables : 1.for comments , called comments
, has 3 columns : id
, name
, comment
2. ip of user did rating , called voted_ip
and has 3 columns id
, comment_id
, user_ip
the purpose of voted_ip table need save ip address each rate validate it cannot rate again if exists.
i created foreign key child table voted_ip
in column comment_id
connecting parent table comments
in column id
following steps @ link , video on how create working foreign key except child table still not update after comment or rate inserted.
as follow :
i thought there might step or have in php side of project. missing?
data not inserted in other table "voted_ip" on insertion in "comment" have add explicitly constraints checking not adding data in other table automatically.
Comments
Post a Comment