I’ve been trying to find the mistake here for a while, but i really can’t see it. I have a register form (with post method) and i want to submit that info to my database in mysql (phpmyadmin). I’ve made the conexion to the data base and it should work, but it isn’t.
Can anyone see the mistake? Everithing is running in my localhost.
God bless you!
form code:
<form action="php/registro_usuario_be.php" method="POST" class="formulario_register">
<h2>Registrarse</h2>
<input type="text" name="nombre" placeholder="nombre completo "/>
<input type="text" name="email" placeholder="correo electrónico">
<input type="text" name="usuario" placeholder="usuario">
<input type="password" name="password" placeholder="contraseña">
<button>Registrarse</button>
Conexion php code:
<?php
$conexion = mysqli_connect("localhost", "root", "", "metapass");
?>
the other php code:
<?php
include 'conexion_be.php';
$nombre = $_POST['nombre'];
$email = $_POST['email'];
$usuario = $_POST('usuario');
$password = $_POST('password');
$query = "INSERT INTO users(nombre, email, usuario, password)
VALUES('$nombre', '$email', '$usuario', '$password')";
$ejecutar = mysqli_query($conexion, $query);
?>
phpmyadmin screenshot:
