mysqli insert problem

Posted by Simon on Stack Overflow See other posts from Stack Overflow or by Simon
Published on 2010-05-19T13:33:07Z Indexed on 2010/05/19 13:50 UTC
Read the original article Hit count: 324

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about mysqli

Related posts about php5