When there is more than one query in the same file it shows errors, I solve everything using$stmt->close();
I was presented with the doubt of which is the correct way of its use, how many close()
should be used.
The $stmt->free_result()
fulfills the same function if it is used, it should no longer be used close()
or if it is used close()
it should no longer be usedfree_result()
Can you explain me?
if ($stmt->fetch()) {
echo "Resultados";
} $stmt->close();
else {
$stmt->close();
echo "No existe resultados";
}
Y
while ($stmt->fetch()) {
echo "Resultados";
}
$stmt->close();
else {
$stmt->close();
echo "No existe resultados";
}