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 trial

PHP

Having 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

I 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