0
    {
    $SQL = $odb -> prepare("SELECT `membership` FROM `users` WHERE `ID` = :id");
    $count = $odb->num_rows;
    $SQL -> execute(array(':id' => $_SESSION['ID']));
    if ($count > 0){
        return true;
        } else {
        return false;
    }
}

What am I doing wrong?

The data must be retrieved from the database of User. And if the value of membership is 0, then get Return False deployed. If not, return True. But the script does not work ... What am I doing wrong?

1
  • 3
    does not work is never a good problem description. How is the result you're currently getting different from what you want? Please elaborate. Commented Oct 14, 2013 at 19:58

1 Answer 1

6

Put $count = $odb->num_rows; below $SQL -> execute(array(':id' => $_SESSION['ID']));

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.