Question regarding Foreign Keys
#1

Hey, I have tested foreign keys now on my MySQL database and I was wondering about something
I have set it to CASCADE on both, now I have a question, when I delete a row from the parent table it does remove the row from the child, But, when I add a new row it adds nothing on the child table, can I do it to add it automatically ?

Another question: After I delete a row - let's say it's ID is 1, then after I remove it and create the next one then the ID is 2, I mean how can I do it to do the smallest number available
Reply
#2

Bump
Reply
#3

Try reading this,

It should provide you with what you need. MYSQL Foreign Key
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)