I'm trying to update a field that has relationship with another field in a different table, but it wouldn't let me do it. For example: I have a customer table with a customer id as the key. I also have another table containing username and password with a key and also customer id field that link to customer table.
This is the code that I'm using:
function AddUser($database, $host, $db_user, $db_pass, $cusid, $username, $password) { //add user to table logins
$linkID = mysql_connect($host, $db_user, $db_pass);
mysql_select_db($database, $linkID);
$password = Encrypt($password);
$username = Encrypt($username);
mysql_query("INSERT INTO logins VALUES ('', '$cusid', '$username', '$password', '', '', '')", $linkID);
}
Everything get added correctly, but the customer id field is left as "0".