this is the code that gives user agent and other stuff
$username = mysqli_real_escape_string($db, $_POST['username']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$ip = mysqli_real_escape_string($db, $_SERVER['REMOTE_ADDR']);
$ua = mysqli_real_escape_string($db, $_SERVER['HTTP_USER_AGENT']); //user agent
$password1 = mysqli_real_escape_string($db, $_POST['password1']);
$password2 = mysqli_real_escape_string($db, $_POST['password2']);
this is when it inserts
$query = "INSERT INTO users (username, email, password, ip, uagent)
VALUES('$username', '$email', '$password', '$ip', '$ua')";
mysqli_query($db, $query);
$_SESSION['username'] = $username;
$_SESSION['success'] = "You are now logged in";
header('location: index.php');
and this is the table code
CREATE TABLE `users` (
`ID` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`Username` varchar(100) NOT NULL,
`Password` varchar(100) NOT NULL,
`Email` varchar(100) NOT NULL,
`IP` varchar(20) NOT NULL DEFAULT '',
`UAgent` varchar(50) NOT NULL
);
idk why but it doesn't work it doesn't give any data to the database but if I remove the user agent part then it works I get the username, password, email and ip but i want user agent too