Add links to data in HTML table Created using PHP and a MYSQL database
<p>I am trying to pull data from a table in PHPmyadmin and convert it to an HTML table based on some customer form input which filters out unneeded rows. The code below does that fine. The issue is that two of my columns need to contain links.</p>

<p>It would be easy enough to use PHP to change the table data into the link using a <code>strtolower()</code> and <code>str_replace()</code> to remove spaces, then concatinating the "www.website.com/" and the ".html". But I'm using a foreach loop to get all of the rows that I need and I don't know how to only alter one value per row. </p>

<p>I have tried using "Broswer Display Transformations" and "Input Transformations" in PHPmyadmin, but that only seems to affect the data in PHPmyadmin and not when I access the data via PHP.</p>

<p>My current code:</p>

<pre><code>//* Code for Table
$query = "SELECT $searchFields FROM `hose_reels` $searchPhrase ORDER BY `model` ASC";

$result = mysqli_query($cxn,$query);

if ($row[$key] != "0") {

echo '&lt;table width="100%" border="1" class="table"&gt;&lt;tr&gt;';
$row = $result-&gt;fetch_assoc();
foreach ($row AS $key =&gt; $value) {
    $key = ucwords(str_replace('_', ' ', $key));
    echo "&lt;th&gt;" . $key . "&lt;/th&gt;";
    }
echo "&lt;/tr&gt;";
$result2 = mysqli_query($cxn,$query);
while($row = $result2-&gt;fetch_assoc()) {
    echo "&lt;tr&gt;";
    foreach ($row AS $key =&gt; $value) {
            $row['$key'] = $value;
            echo "&lt;td&gt;$row[$key]&lt;/td&gt;";
        }
    echo "&lt;/tr&gt;";
    }
echo "&lt;/table&gt;";
}
else {
    echo "&lt;p&gt;No results match your selection. Please broaden your search.&lt;/p&gt;";
}
</code></pre>