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 trialShari Staten
11,540 PointsHaving Trouble Passing This Challenge
Could someone please take look at this and explain what I'm doing wrong?
Challenge Task 1 of 3
To set up an account page, you need to select a single member. Change the function to accept the single argument for a member_id.
<?php
function get_member() {
include("connection.php");
try {
$results = $db->query(
"SELECT member_id, email, fullname, level
FROM members WHERE member_id = member_id;
);
$results->bindParam(1, member_id);
$results->Execute();
} catch (Exception $e) {
echo "bad query";
}
$members = $results->fetchAll();
return $members;
}
Please and thank you.
1 Answer
Yoel Dovid Cohen
13,405 PointsI have not goten this far in php yet but I noticed that $db->query dousn't have closing speech marks. Mayby add a limit in your sql.
I hope I am being usfule ELSE ignore me
Shari Staten
11,540 PointsShari Staten
11,540 PointsHere's the correct answer. I appreciate your efforts:
https://teamtreehouse.com/community/can-someone-please-tell-me-whats-wrong-with-my-code-here