mysqli insert problem
- by Simon
Hello
i have this error:
Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables in E:\wamp\www\classes\UserLogin.php on line 31
and i dont know what it is :/
here is my code
function createUser($username, $password) {
$mysql = connect();
if($stmt = $mysql->prepare('INSERT INTO users (username, password, alder, hood, fornavn, efternavn, city, ip, level, email) VALUES (?,?,?,?,?,?,?,?,?,?)')) {
$stmt->bind_param($username,$password, $alder, $hood, $fornavn, $efternavn, $city, $ip, $level, $email);
$stmt->execute();
$stmt->close();
} else {
echo 'error: ' . $mysql->error;
}
then my user create the user they only need to type username and password, and later they can edit the profile and edit, email,alder,hood and like that :).
Thanks for helping me