lung
October 27, 2010, 2:18am
1
$stmt = $conn->prepare("INSERT INTO tbljobseeker(EMail_Address,User_Password,FirstName,LastName,Gender,Date_of_birth,Register_Date,User_Block,Lastvisit_Date,Activate_Code) VALUES(?,?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param($EMail_Address, $sha1pass, $FirstName, $LastName, $Gender, $birth_date,$birth_date,$zero,$birth_date,$activate);
$stmt->execute();
and i get error :Fatal error: Call to a member function bind_param() on a non-object in
The prepare method returned false, instead of a statement object with a bind_param method, because your query could not be prepared. You have 10 columns listed but 11 values, which can’t be right.
lung
October 27, 2010, 5:07am
3
but if i send 10 values,i get this error :Number of elements in type definition string doesn’t match number of bind variables
You can also just pass an array of values directly to the execute() and skip the bindParams mehtod. it has the same effect, less code
$stmt->execute(array($EMail_Address, $sha1pass, $FirstName, $LastName, $Gender, $birth_date,$birth_date,$zero,$birth_date,$activate));
info here http://us2.php.net/manual/en/pdostatement.execute.php