Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Philip Bradbury33,368 Points
Issue finding details on methods
Ive been trying to find some more details on methods... notable the query() and prepare() methods. On searching the PHP manual I can't find any details . I come across the PDO::prepare which I thought could be is and it is a method of PDO but it doesn't hold a lot of information to explain what prepare is. Any ideas/help on what i need to search to find ->query and ->prepare??
Andrew Shook31,709 Points
Phillip, PDO::prepare is the method you are looking for. I'm not sure why they use the scope resolution operator ( the double colons) in the documentation for classes, but it roughly translates to the same thing as (->). However, in code the do mean different things so do use them interchangeably. This is a good page to look over for binding and preparing. What questions about the prepare method do you have?
EDIT: Noticed a few typos in my answer that might cause some problems. "::" and "->" DO NOT mean the same thing when writing code so DO NOT use them interchangeably.