I made a simple registration form. How should i edit this form to add something like : user_id, or date_created? When i add user_id column to PHPMyAdmin, the user can't register, but when i have only the values : 'First Name' ; 'Last Name' ; 'Email' ; 'Password' inside database ,everything works.
<!DOCTYPE html>
<html>
<head>
<title>Registration</title>
</head>
<body>
<?php
$lclhost = "localhost";
$pass = "";
$root = "root";
$database = "regis";
$con=mysqli_connect ("$lclhost", "$root", "$pass") or die("connection fail".mysql_error());
mysqli_select_db($con, $database) or die("database fail".mysql_error());
?>
<form method="get">
First Name : <input type="text" name="fname"><br>
Last Name : <input type="text" name="lname"><br>
Email: <input type="text" name="email"><br>
Password: <input type="Password" name="password">
<input type="submit" name="btnsubmit">
</form>
<?php
if (isset($_GET['btnsubmit']))
{
$fname = $_GET['fname'];
$lname = $_GET['lname'];
$email = $_GET['email'];
$password = $_GET['password'];
$registration = "INSERT INTO tbl_info values ('".$fname."','".$lname."','".$email."','".$password."')";
mysqli_query($con,$registration);
echo "Succes!";
}
?>
</body>
</html>