I am trying to change the rows output by PHP in a table to links. I have added the a href tags to the example below, however it results in an unexpected T_VARIABLE. I have tried it without the extra quotes, but this displays a blank table. I am not sure what the flaw in the logic is.
while($row = mysql_fetch_row($result)) { echo '<tr>'; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo '<td><a href='$cell'</a></td>'; echo '</tr>\n'; }
You need to escape the double quotes as that is your string delimiter.
Or use single quotes