Alex Beyer
Alex Beyer

Reputation: 147

Prepared Statement in PHP not binding results

When I am trying to get this prepared statement to work I am just testing to get data back it is telling me there is not a matching number of bind_results() from the prepared statement. I cannot figure this our there are three selected elements and three elements in the bind_results();

$sql_join_group_data = "SELECT `group_id`, `group`, `group_pass` 
                        FROM `groups` WHERE `group` = 'Knights'";
$stmt4 = $conn->prepare($sql_join_group_data);
$stmt->execute();
$stmt->bind_result($group_id, $group, $group_password);

Upvotes: 0

Views: 40

Answers (1)

Elon Than
Elon Than

Reputation: 9765

You are assigning your statement to $stmt4 but trying to execute and bind from $stmt.

Upvotes: 2

Related Questions