How can I INSERT the values of this function to only WHERE the value of the username column (located in the login table, contains the exact same value as the value of the column nickname (located in a table called active_users).
$stmt = $this->pdo->prepare('INSERT INTO login (device_token) VALUES (?)');
$stmt->execute(array($token));
Additional info: when a user logs in, I set up the API to add the user's name to both username (in the login table) and nickname in the active_users table. Since these values will always be the same for their respective tables, I was hoping we could add some conditional logic to achieve this type of specificity. My goal is to take the device_token parameter and pass it to a different spot in the database.
Edit: Schema
Update AFNetworking command for login
NSMutableDictionary* params =[NSMutableDictionary dictionaryWithObjectsAndKeys:command, @"command", _nicknameTextField.text = fldUsername.text, @"username", hashedPassword, @"password", nil ];
Update: active_users INSERT statment
$stmt = $this->pdo->prepare('INSERT INTO active_users (user_Id, device_token, nickname, secret_code, ip_address) VALUES (?, ?, ?, ?, ?)');
$stmt->execute(array($userId, $token, $name, $code, $_SERVER['REMOTE_ADDR']));



