If I do not close the stmt at the end of this code snippet:
$stmt = $mysqli->prepare("SELECT typeId FROM types WHERE name = 'author'");
$stmt->execute();
$stmt->bind_result($typeId);
$stmt->fetch();
(with this:)
$stmt->close();
Then the following prepared statement fails with error code 0 and no error:
$stmt = $mysqli->prepare("INSERT INTO typeTracker (reserved_id, typeId) VALUES (NULL, ?)");
$stmt->bind_param("i", $typeId);
Why? Is it because I called the bind_result and fetch functions in the first block of code? I don't typically have to close statements before preparing new ones.
Thanks.