<?PHP //--------------- // Connection to server and database //--------------- $host = "localhost"; $basedatos = "techos"; $user = "pablo.puig1"; $passw = "9NA3kSExI2fGE6eV"; try{ $connection = mysqli_connect($host, $user, $passw, $basedatos) or $error = 1; } catch(Exception $ex){ print("Error connecting to database: ". $ex->getMessage()) and die(); } ?> <?PHP $name = $_POST['username']; $acc_type = $_POST['ACC']; $email = $_POST['email']; $phone_num = $_POST['phone']; $queryAddUser = "INSERT INTO users (name, acc_type, email, phone_num) VALUES ('$name', '$acc_type', '$email', '$phone_num')"; mysqli_query($connection, $queryAddUser); // $stmtAdd = mysqli_prepare($connection, $queryAddUser); // mysqli_stmt_execute($stmtAdd); header("Location: usersTable.php"); exit(); ?>