0

When I execute the prepared statement the results are returned empty. If I copy and paste the statement into phpMyAdmin it executes properly. $_SESSION['userGroup'] has been checked and confirmed to contain the proper value but $systems remains undefined.

Am I missing something?

        $stmt = $mysqli -> prepare("SELECT `Systems` FROM `groups` WHERE `GroupID` = ?");
            echo $mysqli -> error;

        $stmt -> bind_param('i', $_SESSION['userGroup']);
        $stmt -> execute();
        $stmt -> store_result();
        $stmt -> bind_result($systems);
0

2 Answers 2

1

Am I missing something?

you are missing documentation and/or tutorial to learn from.
Where you can learn the proper syntax that should include

$stmt -> fetch();
Sign up to request clarification or add additional context in comments.

Comments

0

Just try

$stmt -> bind_param('i', $_SESSION['userGroup']);
$stmt -> execute();
$stmt -> bind_result($systems);
$stmt -> fetch();

1 Comment

Yes, that's exactly what I was looking for. I had just been looking at it too long. Thank you.

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.