title: php replacing query duplicates for empty strings
body: <p>i have the following script to retrieve sql data:</p>
  
  <pre><code>  // Present data if avail
    if ($result-&gt;num_rows &gt; 0) {
     // Query output in tabels
     while($row = $result-&gt;fetch_assoc()) {
         echo '&lt;tr&gt; &lt;td class="tg"&gt;' .$row["id"]. '&lt;/td&gt;' . "\n";
         echo '&lt;td class="tg"&gt;' .$row["fname"]. '&lt;/td&gt;' . "\n";
         echo '&lt;td class="tg"&gt;' .$row["lname"]. '&lt;/td&gt;' . "\n";
         echo '&lt;td class="tg"&gt;' .$row["make"].  '&lt;/td&gt;&lt;/tr&gt;' . "\n";      
  
     }
     // if no records
    } else {
        echo "0 results";
    }
  </code></pre>
  
  <p>How can i replace duplicates in the row 'fname' for empty strings? (records are being ordered by fname)</p>