Print same values once in a while loop
<pre><code>$query = mysql_query("SELECT * FROM tblname");
while($fetch =mysql_fetch_array($query)) {
$name = $fetch['name'];

echo "$name";

}
</code></pre>

<p>In my example, after echoing out $name in a while, the values are:</p>

<pre><code>Carrots
Lemon
Carrots
Lemon
</code></pre>

<p>Is there a way to not repeat printing the same value that will look like this:</p>

<pre><code>Carrots
Lemon
</code></pre>

<p>Thank you very much.</p>
