Understanding fetch_assoc() : <p>I am trying to understand how/why fetch_assoc works the way it does. 
I have the following piece of code: </p>

<pre><code>$results = $connectToDb-&gt;fetch("SELECT * FROM customer");
$resultsArray = $results-&gt;fetch_assoc();
print_r($resultsArray);  //print_r 1

while($row = $results-&gt;fetch_assoc()){
    print_r($row);       //print_r 2
}
</code></pre>

<p>The query returns 3 rows from a table.
Why does the 1st print_r return only the 1st row of the queried data but the 2nd print_r returns all 3? How does putting fetch_assoc into a while loop tell it to do the action more than once? I read that fetch_assoc returns either an associative array or NULL but I'm struggling to understand how the while loop "tells" fetch_assoc to fetch the next row, if that makes sense?</p>

<p>Thank you.</p>
