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_ipand 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 : the foreign key creation

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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -