I have a query about mysql, I currently have two user tables where my main key is dni and in session. id and I have a form from php in which I update the data of a person .. my query is as follows:
Can I update the data of my main user key? in this case it is the user ID ...
I made this query in sql and it changes all the data, but when I want to modify the ID (the cedula) it always remains with it. I hope you can help me. Thanks
'$sql = "UPDATE usuarios u JOIN sesion s SET u.cedula='$cedula', u.nombres='$nombres', u.apellidos='$apellidos', u.telefono='$telefono', u.direccion='$direccion', s.correo='$correo', s.usuario='$usuario' WHERE s.usuarios_cedula='$cedula' && u.cedula='$cedula'";'