Hello, all good? I have a problem in performing data insertion in a MYSQL database. When I type a password in my form, for example: metas123, or any other password, it stores the value 0, instead of the string typed, and I really have no idea why this happens ... if you can help me thank you very.
if (!empty($_POST['user']) and !empty($_POST['pass'])) {
$g_user = mysqli_real_escape_string($conn, $_POST['user']);
$g_pass = $_POST['pass'];
$sql = "INSERT INTO usuarios (usuario, senha) VALUES ('$g_user', '$g_pass');";
$executa = mysqli_query($conn, $sql);
switch ($executa) {
case true:
header("Location: login_page/index.php?cadastro=sucesso");
break;
default:
header("Location: index.php?cadastro=erro");
break;
}
}
* Insert code to mysql database