Assigning multiple data to var inside loop and trying to use var outside the loop
<p>I have 5 pieces of data.</p>

<p>I put all 5 pieces of data into a variable inside a while loop. Then, I am trying to that use variable outside of the while loop - but have all of the data that was put in, still echo.</p>

<p>Currently, I am able to put the data in, and successfully get 1 piece of data out. I would like to echo all 5 pieces of data.</p>

<p>Code:</p>

<pre><code>        $s = &lt;a search query that gets data from external db&gt;
        while($data = $r-&gt;FetchRow($s)) { 
        $addr = 'test address';
        if($data['image'] == '') { $data['image'] = 'nophoto.jpg';}
            $a = '&lt;div style="height: 85px; width: 100%;"&gt;&lt;img src="http://website.com/'.$data['image'].'" align="left" border="0" hspace="15" alt="Click for details" height="85px" width="120px" /&gt;'.$addr.'';
                                    }
        $m = "This is a test message &lt;br /&gt;" .
        $m = "".$a."" . 
        $m = "This is the end of a test message";
        echo $m;
</code></pre>