Reputation: 117
I receive the following error:
Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables
My code is:
$query = "INSERT INTO $db_table(userFullName,userName,userExEmail,userPhone,userDOB) VALUES(?,?,?,?,?)";
//Binding to Prevent SQL injection
$requery = $mysqli_db->prepare($query);
$requery->bind_param("ssssss",$webmailFullName,$webmailUserName,$webmailExEmail,$webmailPhone,$webmailDOB);
I'm sure the problem is the field in MySQL called userDOB which is set a SQL date field on my webpage server.
The form which gives $webmailDOB is a jQuery ui datepicker widget which passes the date in MM/DD/YY. As a post I think its passed as a string?
I think my problem is sssss?
I need to convert that last s to a date in the SQL format?
I don't know how to implement it so can someone show me the code needed to stop this error happening?
Thanks
Upvotes: 0
Views: 307
Reputation: 157839
You are getting this error because number of elements in type definition string doesn't match number of bind variables
Upvotes: 2