Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmijurg
16,044 PointsWorking with results challenge is misleading and wrong. Here is why:
What i am talking about is "Working with results" challenge that is in PHP path > Integrating php with databases. First what is wrong about that is the statement that says "The data from the database is currently in a PDOStatement object named $results" , well that is completely not true. $results that is given in that context is not PDOStatement object, but PDO object itself. You can copy the code and var_dump it. But bottom line is that you do not call query method on PDOStatement, you do that on PDO object itself. And then what you get is PDOStatement object.
Second thing is that $results variable actually is not seen in code that is suppose to show what it is.(Though it is clearly a PDO object, because you can see $results->query(); method called on it, that is what shows that it is not PDOStatement object.)
In my opinion this challenge and this course is poorly made , because it focuses too much on OOP, before we even get to OOP. And mistake like this , i think misleads even more.
code given:
<?php
include "helper.php";
/*
* helper.php contains
* $results->query("SELECT member_id, email, fullname, level FROM members");
*/
1 Answer
mijurg
16,044 PointsAlena Holligan , i would be happy to join QA team, though i can't seem to find a way to privately contact you.
Alena Holligan
Treehouse Teacheryou can simply reply to any badge unlock email :) yes I do monitor that account :)
Alena Holligan
Treehouse TeacherAlena Holligan
Treehouse TeacherI am truly sorry for the confusion and appreciate the feedback. I have updated the code challenge to HOPEFULLY be better explained. If you have additional suggestions, please let me know. You can also email me directly.
Determining in what order to teach concepts is extremely challenging. Most people are introduced to using object such as this long before they actually write or fully understand objects, which is why we chose to add this course before fully exploring OOP.
Specific constructive feedback is always appreciated and I would be happy to have you on the QA team if you are interested.