I had a loop like that :
foreach($Fields as $Name => $Value){
$Query->bindParam(':'.$Name, $Value, PDO::PARAM_STR);
}
Nothing complicated. However, each value was set to the last one in the array ($Fields).
How can I fix that ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
However, thanks to this guys. I found out that you need to pass the value by reference with a
&before like that :This was driving me nuts.
Actual quote from PHP.net :