<?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!";
?>
连接正常,但未插入值。如何改进我的代码?我不明白为什么这些值没有插入到数据库中。我检查了变量,它们很好。