PHP ::: Prepared Statments ::: freeresult() ::: close()
<p>What is the importance of using:</p>

<pre><code>$stmt-&gt;free_result();
$stmt-&gt;close();
</code></pre>

<p>After a database call using prepared statments like this:    </p>

<pre><code>$mysqli=new mysqli("database", "db", "pass", "user");

$stmt = $mysqli-&gt;prepare("SELECT email FROM users WHERE id=? ");
$stmt-&gt;bind_param('i',$_SESSION['id']);
$stmt-&gt;execute();
$stmt-&gt;bind_result($email);
while($stmt-&gt;fetch()){
     echo $email;
}
$stmt-&gt;free_result(); //why do i need this?
$stmt-&gt;close();       //why do i need this?
</code></pre>

<p>Im asking because I do not see any noticeable performance degradation without them. Are those commands usually only used for when I store the result using:</p>

<pre><code>$stmt-&gt;store_result();
</code></pre>

<p>Like this:</p>

<pre><code>$mysqli=new mysqli("database", "db", "pass", "user");

$stmt = $mysqli-&gt;prepare("SELECT email FROM users WHERE id=? ");
$stmt-&gt;bind_param('i',$_SESSION['id']);
$stmt-&gt;execute();
$stmt-&gt;store_result();
$stmt-&gt;bind_result($email);
while($stmt-&gt;fetch()){
     echo $email;
}
$stmt-&gt;free_result(); //why do i need this?
$stmt-&gt;close();       //why do i need this?
</code></pre>

<p>Ultimately the question comes down to when is the appropriate time to use freeresult() and close()?</p>
