All,
I don’t really understand the usage case for named placeholders bindParam(':blabla', $blabla) versus numbered placeholders bindParam(1, $blabla). Is it mostly a question of readability?
Thanks,
JDelage
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.
numbered placeholders will prove to be a PITA when you want to expand your query by adding an additional placeholder in the middle, requiring you to renumber everywhere you use placeholders after the placeholder you just inserted.
Named placeholders, on the other hand, won’t have this problem, as the position of the placeholder does not matter for the binding of the placeholder.