Not really, if the foreign key value changes, it loses the relational link to the primary key. So you then lose the integrity of the information as the row values will link to another primary key value of different data, or nothing if it doesn't exist causing an error.
You can physically change the foreign key value to match to another primary key value, when modifying a mistake made, e.g. the foreign key's record meaning to match a different primary key's record.
E.g. Employees and Employee Scores.
Employee101 scored at 55%
Employee102 scored at 60%
Say that these have (somehow!) mixed around in the database, so you have to change the foreign key EmployeeID of Employee102 (in the Scored table), to the EmployeeID of Employee101 so that Employeee101 scored 60% (and vice versa otherwise Employee101 scores both 55% and 60%).
This type of mistake wouldn't really happen unless you coded the front end to mess with the values input into the system.
Hi, I am a newbie in developing a website. i have tried to connect using mysqli conncetion
Here is my simple code.
// db.php code
//$con = mysqli_connect("localhost","root","","bakery"); ...
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...