PHP combine values from loop
<p>If I want to display the text as follows in example, how can it be done?</p>

<pre><code>$tmp=mysql_query("SELECT ... FROM ....");
$total=mysql_num_rows($tmp);
$tekst1='Your total number of friends are: '.$total.'. Your friends are: ';
while($p=mysql_fetch_array($tmp)) {
$tekst2=$p['friend'].", ";
}
$text_complete=$tekst1.$tekst2;
echo $text_complete;
</code></pre>

<p>$text_complete should look like: "Your total number of friends are: 3. Your friends are: John, Mike, Michael". But, using this code above I get "Your total number of friends are: 3. Your friends are: John,"</p>

<p>How can I combine both texts, the one obtained from the loop and the one which is fixed?</p>
