$con = mysqli_connect('localhost', 'root','', 'dbname');
if(filter_input(INPUT_POST, "register")){
$username = filter_input(INPUT_POST,'username');
$password = filter_input(INPUT_POST,'password');
$email = filter_input(INPUT_POST,'email');
$stmtInsertUser = $con -> prepare("INSERT INTO tbl_users (username, password, email) values (?, ?, ?)");
$stmtInsertUser -> bind_param($username, $password, $email);
$stmtInsertUser -> execute();
這是我的代碼,並返回該錯誤
Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables in C:\xampp\htdocs\xxx\xxx\PHPregister.php on line 10
謝謝!
閱讀[ bind_param的文檔](http://www.php.net/manual/en/mysqli-stmt.bind-param.php) - 你的論點是錯誤的。 – Kryten