<?php
...........
$connection = mysqli_connect('......com', 'login', 'password',
'dbname');
if (!$connection) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
echo "Connection Successful";
// creating a query
mysqli_query($connection, "INSERT INTO `users` (`userid`,`firstname`, `lastname`, `username`, `email`,
`password`) VALUES (NULL, $firstname, $lastname, $username,$email,$password);");
mysqli_close($connection);
// printing to the screen
echo "Welcome $lastname . You have successfully logged in!";
?>
The connection is OK, but the values do not get inserted. How can I improve my code? I do not understand why the values donot get inserted into the database. I have checked the variables, they are fine.