How do I make certain columns of a php->html to be links? Currently, I am trying to fetch each header row and printing the link based on the header. Here is my code:
// printing table rows
$rowCtr = 1;
while($row = mysql_fetch_row($result)){
$i = 0;
foreach($row as $cell){
// This is the part not working.
$field = mysql_fetch_field($result, $i);
if ($field->name == "name" || "id"){
$link = "http://random.com?Ident={$cell}";
echo "<td><a href='$link'>$cell</a></td>";
} else {
echo '<td>$cell</td>';
}
$i++;
}
echo '</tr>
';
$rowCtr++;
}