while inside a while loop causing some part of the array to disappear
<p>Here's a quick explanation:</p>

<p>My first while pulls four tv shows from the database. My second one finds if the current user has rated any of them.
Funny thing is, if my second while loop doesn't find a score for one of the four tv shows pulled from the db, the unrated tv show doesn't display at all (so if the user gave a score to three of them, the fourth unrated one disappears.)... Why is that ?</p>

<p>Below I have a radio form where I want to precheck the score a user gave to the tv show (I would check if the score exists and add "checked" to the corresponding HTML line).</p>

<pre><code>&lt;?php
try {
    $conn = new PDO('mysql:host=localhost;dbname=mytvbox', $username, $password);
    $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);   

    $stmt = $conn-&gt;prepare('SELECT * FROM shows WHERE id &gt; (SELECT MAX(id) - 4 FROM shows)');
    $stmt-&gt;execute(array('id' =&gt; $id));

    while($row = $stmt-&gt;fetch()) {



    $show_id = $row[0];

    $requete = "SELECT * FROM show_score WHERE show_id = $show_id  AND user_id =  $user_id";
    $score = $conn-&gt;prepare($requete);
    $score-&gt;execute(array('show_id' =&gt; $show_id));

    while($row_score = $score-&gt;fetch()) {
            var_dump($row_score);


?&gt;


&lt;div id="index-last-shows" class="three columns"&gt;
&lt;div class="tip"&gt;
    &lt;a href="&lt;?php echo $row[0];  ?&gt;"&gt;&lt;img src="&lt;?php echo $row[4];  ?&gt;" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class="tip-content"&gt;   
    &lt;div class="tip-container"&gt;
        &lt;div class="tip-header"&gt;
            &lt;h1&gt;   &lt;?php echo $row[1];  ?&gt;      &lt;/h1&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
            &lt;div class="twelve columns"&gt;
             &lt;div id="flash"&gt;&lt;/div&gt;
                &lt;form id="&lt;?php echo $row[0]; ?&gt;"&gt;
                    &lt;div class="your-score"&gt;
                        &lt;div class=""&gt;Your Score&lt;/div&gt; &lt;div id="flash"&gt;&lt;/div&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="1" title="1"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="2" title="2"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="3" title="3"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="4" title="4"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="5" title="5"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="6" title="6"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="7" title="7"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="8" title="8"/&gt;
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="9" title="9"/&gt;   
                         &lt;input class="hover-star" type="radio" name="tvshowrating" value="10" title="10"/&gt;    
                         &lt;input type="hidden" id="show_id-&lt;?php echo $row[0]; ?&gt;" value="&lt;?php echo $row[0]; ?&gt;" /&gt; 
                         &lt;input type="hidden" id="user_id-&lt;?php echo $row[0]; ?&gt;" value="&lt;?php echo $user_id ?&gt;" /&gt;
                         &lt;span id="hover-test" style="margin:0 0 0 20px;"&gt;&lt;/span&gt;
                         &lt;input id="submitscore" type="submit" value="Submit scores!" onclick="addScore(&lt;?php echo $row[0]; ?&gt;);" /&gt;  
                    &lt;/div&gt;
                &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>Edit: language a bit more clear.</p>

<p>Edit 2 : I'll put some screen shots of what's happening. If I put the closing brackets after the var_dump I get this: <a href="http://i.imgur.com/CrnsnIe.jpg" rel="nofollow">http://i.imgur.com/CrnsnIe.jpg</a>, if I put them at the end like I need them to be I get this <a href="http://i.imgur.com/zVqMOiX.jpg" rel="nofollow">http://i.imgur.com/zVqMOiX.jpg</a></p>
