Specifically I have a form which has to fill a table or another depending on the first option chosen, the problem is that the input is the same for both tables and I have to include the 2 name to it, is this possible? , in the test that I did I filled the table but all in white.
This would be my php code:
if($boton == "Guardar"){
if($rol == 1){
$pg = "insert into usuarios (usuario, clave, id_rol, correo_usuario) values ('$usuario', '$encriptar', '$rol', '$usuario')";
$pg1 = "insert into analista (nombre_analista, apellido_analista, correo_analista, telefono_analista, cedula_analista) values ('$nombre', '$apellido', '$correo', '$telefono', '$cedula')";
if(pg_query($pg) && pg_query($pg1)){
$_SESSION['guardo'] = $guardo;
}else{
echo $error;
}
}else if($rol == 2){
$pg = "insert into usuarios (usuario, clave, id_rol, correo_usuario) values ('$usuario', '$encriptar', '$rol', '$usuario')";
$pg1 = "insert into instructor (nombre_instructor, apellido_intructor, correo_instructor, telefono_instructor, cedula_instructor) values ('$nombre', '$apellido', '$correo', '$telefono', '$cedula')";
if(pg_query($pg) && pg_query($pg1)){
$_SESSION['guardo'] = $guardo;
}else{
echo $error;
}
}
}
And I have the basic input as follows:
<input type="text" name="nombre_analista, nombre_instructor" class="form-control">
If you can put the 2 name at the same input or there is another way to do what I need