I have a table of prices.
I am running a simple while function to display the table of prices in HTML
I want to change all prices that are 0 into ‘call’ when displayed in html, without changing the actual mysql table.
can i do this with a foreach function within the loop somehow?
while ($result1 = mysql_fetch_array($query1)) {
foreach ($result1[] as $key => $value) {
if ($key == '0') {$value='Call';}// ????
echo "<tr>";
echo "<td>";
echo $result1['type'];
echo "</td><td>";
echo $result1['25'];
echo "</td><td>";
echo $result1['50'];
echo "</td><td>";
echo $result1['100'];
echo "</td><td>";
echo $result1['250'];
echo "</td><td>";
echo $result1['500'];
echo "</td><td>";
echo $result1['plus'];
echo "</td><td>";
echo "</tr>";
}
(same as)