I have the following PHP PDO statement:
$STH = $this->_db->prepare("INSERT INTO UserDetails (FirstName, LastName,
Address, City, County, PostCode, Phone, Mobile, Sex, DOB,
FundraisingAim, WeeksAim, LengthsAim, HearAboutID,
MotivationID, WelcomePackID, ContactPrefID, TitleID)
VALUES
(:firstName, :lastName, :address, :city, :county, :postCode,
:phone, :mobile, :sex, :DOB, :fundraisingAim, :weeksAim,
:lengthsAim, :hearAbout, :motivation,
:welcomePackPref, :contactPref, :title)");
$STH->execute($userData);
Where $userData
is an associative array. I've double checked the names and I don't understand why I'm getting the following error:
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
What silly mistake have I made?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…