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 trialUnsubscribed User
8,428 PointsHow to use PDO inside of child of PDO?
I am not sure how to go about using PDO inside of a child of PDO for this task. Any pointers?
<?php
class sqlRepository extends PDO implements RepositoryInterface
{
public function all($entity){
parent::prepare();
}
}
1 Answer
Frederik Hulleman
PHP Development Techdegree Graduate 15,232 PointsCan you give some more info on what you're struggling with? And what goes wrong? Which errors you're getting? What different solutions you tried?
Unsubscribed User
8,428 PointsUnsubscribed User
8,428 PointsI ended up solving the issue with the help of some other conversations from another question.
While I was a little unclear on the syntax for using methods within a child class I was mostly getting hung up in the challenge due to using PDO::prepare instead of PDO::query. The challenge only passed when using query with variables written directly into an sql statement vs a prepared statement.
Thanks for checking in on my issue, I appreciate your engagement and follow up.