SA-MP Forums Archive
Question regarding Foreign Keys - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question regarding Foreign Keys (/showthread.php?tid=618821)



Question regarding Foreign Keys - NeXoR - 10.10.2016

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


Re: Question regarding Foreign Keys - NeXoR - 10.10.2016

Bump


Re: Question regarding Foreign Keys - azzerking - 10.10.2016

Try reading this,

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