0
I have:
<label class="">
<input name="user_perfil" type="radio" value="administrador"> Administrador
</label>
<label class="">
<input name="user_perfil" type="radio" value="cliente"> Cliente
</label>
And in my database I have a column:
enum('administrador', 'cliente', 'suporte_tecnico')
I’m picking up the POST that contains the value of the radio button:
$perfil = $_POST['user_perfil'];
And I’m calling a function:
function novoUsuario($conexao, $user, $password, $email, $nome, $perfil)
{
$query = "INSERT INTO usuarios (user_name, user_password_hash, user_email, user_fullname, rank)
VALUES ('{$user}', '{$user_password_hash}', '{$email}', '{$nome}', '{$perfil}')";
return mysqli_query($conexao, $query);
}
But in my bank the rank value is not being saved. I will use this rank to open specific pages for each value (Adm, support, etc).
What I’m doing wrong my friends?
Checked if the value is getting to php? type: die($profile), and changing the selected option?
– mau humor
It really looks all right, debug the value that is coming with the 'print_r($_POST)', if you are going the right values, debug the query with the 'or die(mysqli_error()', try to post here the results of this.
– Daniel Costa