prepare($sql); $stmt->bind_param('ssssssss',$nome,$empty,$empty,$empty,$empty,$email,$empty,$empty); if($stmt->execute()) { $id=$stmt->insert_id; $stmt->close(); $sql = "INSERT INTO login_usuarios (login,senha,tipo,id_cliente) VALUES(?,?,?,?)"; $hashed = password_hash($senha,PASSWORD_DEFAULT); $stmt = $con->prepare($sql); $stmt->bind_param('ssss',$usuario,$hashed,$tipo,$id); if($stmt->execute()) { $_SESSION['msg'] = "Configurado com sucess, por favor faça o login!"; unset($_SESSION['setup']); } else{ $_SESSION['msg'] = "Erro no cadastro!"; } $stmt->close(); header('Location: ../index.php'); } ?>