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 trialEsmee Fulcher
923 PointsStuck on using prepare statement task 1
I thought I had the right answer but it isn't right but I don't see what I have done wrong so cannot find the correct answer
<?php
function get_member() {
include("connection.php");
try {
$results = $db->query(
"SELECT member_id
FROM members"
);
} catch (Exception $e) {
echo "bad query";
}
$members = $results->fetchAll();
return $members;
}
1 Answer
Steven Parker
231,198 PointsIt doesn't look like you've changed anything yet, but the instructions for task 1 say "Change the function to accept the single argument for a member_id
."
So where the function is defined on line 2, you need to add the parameter name within the parentheses (and don't forget the "$").