This Error appears to me when executing, the weirdest thing is that it registers, but not the username.
Why do not you register me? I will put the code of the pages here so you can visualize it better. On the other hand. Because if there is no other record, the iduser field appears, which is AI in 6? Should not it restart when there are no others? How can I do that? that if there is no other start from 1 again ...? Thinking this well, it is somewhat complicated to make use of the autoincremental field since how it is done when a user is deleted and the sequence is lost? it looks ugly ... 1 ... 2 ... 5: S
- Form1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Taller Mecanico</title>
</head>
<body>
<h1> Registro de Usuarios</h1>
<form action="r1usuario.php" method="post">
Ingrese su USERNAME:
<input type="text" name="username" /><br />
Ingrese su CONTRASEÑA:
<input type="password" placeholder="pass" name="password_u" /><br />
Seleccione Tipo de USUARIO:
<select name="tipo_u"><br />
<option value="1">Administrador</option>
<option value="2">Recepcionista</option>
<option value="3">Mecanico</option>
</select><br />
<input type="submit" value="Resgistrar" />
</form>
</body>
</html>
- r1usuario.php
< -! - DOCTYPE html > // what problem when putting this in code type the page takes it and does not show it haha
< -html- >
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Registro de Usuario</title>
</head>
<body>
<?php
$conexion=mysqli_connect("localhost","root","","taller_bdphp")
or die ("Problemas con la conexion ");
mysqli_query($conexion, "INSERT INTO usuarios(username,password_u,tipo_u)VALUES ('$_REQUEST[username]',$_REQUEST[password_u],$_REQUEST[tipo_u])")
or die ("Problemas en el SELECT" .mysqli_error($conexion)); mysqli_close($conexion);
echo ("El USUARIO fue REGISTRADO ");
?>
</body>
</html>