I was wondering if any one had any ideas on the meaning of this error
PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens Database.php on line 95
lines 83 - 97 database.php
ksort($data);
//$fieldNames = implode(', ', array_keys($data)); /// to be tested
$fieldNames = implode('`, `', array_keys($data));
$fieldValues = ':' . implode(', :', array_keys($data));
$sth = $WIdb->prepare("INSERT INTO $table (`$fieldNames`) VALUES ($fieldValues)");
foreach ($data as $key => $value) {
$sth->bindValue(":$key", $value);
}
$sth->execute();
$sth->closeCursor();
my insert for db
$this->WIdb->insert("WI_Members", array(
":email" => $user['email'],
":username" => strip_tags($user['username']),
":password" => $this->hashPassword($user['password']),
":full_name" => strip_tags($user['full_name']),
":birthday" => $full_birthday,
":gender" => $user['gender'],
":country" => $user['country'],
":confirmed" => $confirmed,
":confirmation_key" => $key,
":register_date" => date("Y-m-d")
));
trying to re-code my site, to stop sql injection, its passed all validation,
i have done a VAR DUMP
["email"]=>
string(21) "test@googlemail.com"
["username"]=>
string(12) "warner"
["full_name"]=>
string(6) "Jules "
["password"]=>
string(128) "db0773097ac0e01005f698bc50488524f3bea68b545ad35aa8ac73ce5c3b447b82aebcab45763a650a9195caf11cf9e7fd3f6f67265f371702ef07128bb65cdf"
["confirm_password"]=>
string(128) "db0773097ac0e01005f698bc50488524f3bea68b545ad35aa8ac73ce5c3b447b82aebcab45763a650a9195caf11cf9e7fd3f6f67265f371702ef07128bb65cdf"
["gender"]=>
string(1) "m"
["birthmonth"]=>
string(2) "02"
["birthday"]=>
string(2) "22"
["birthyear"]=>
string(4) "1980"
["country"]=>
string(14) "United Kingdom"
["bot_sum"]=>
string(2) "10"
i have looked over a few forums, i have tried a number of bits, nothing seems to work, and i have been awake 24 hours trying to fix this, so figured i would try here fresh might help lol
and thank you all for your time