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.

PHP PHP & Databases with PDO PDO Queries & Results PDO Queries & Results

Wouldn't the answer be the query method? I can't get it right and yet the documentation also says query method.

I know from other PHP PDO videos you can run the exec method but I tried that also with no avail. Anyone have a clue on what the answer might be?

Nathan

You don't say which question you're asking. But if it's "What method would you use on a PDOStatement object to bring back a result set?", then from the first video in this section you see that the query method returns a PDOStatement object. So the query method has already been used at this point and it has returned the PDOStatement object. So the question is asking which method you can use on the PDOStatement object to get a set of results. Watch the first 1 min 20sec of the second video in the section.

Okay so they were just being picky. It's a method so you do need the opening and closing curly braces on the method call. Oh and it's the query method.