dont_be_hasty Posted February 2, 2009 Share Posted February 2, 2009 Hi, Im coding in php and i want to display my results in a table. Here is my code: echo "<table>"; echo " <tr> <td>$row1['name']</td> <td>$row2['name']</td> </tr>"; echo "</table>"; mysql_close(); ?> I keep this the following error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 48 Line 48 is: <td>$row1['name']</td> Any help will be great - Thanks Link to comment https://forums.phpfreaks.com/topic/143530-html-table-in-php/ Share on other sites More sharing options...
Snart Posted February 2, 2009 Share Posted February 2, 2009 echo "<table>"; echo " <tr> <td>".$row1['name']."</td> <td>".$row2['name']."</td> </tr>"; echo "</table>"; Link to comment https://forums.phpfreaks.com/topic/143530-html-table-in-php/#findComment-752985 Share on other sites More sharing options...
genericnumber1 Posted February 2, 2009 Share Posted February 2, 2009 or another alternative, for the brace-lovers: <?php echo "<table>"; echo " <tr> <td>{$row1['name']}</td> <td>{$row2['name']}</td> </tr>"; echo "</table>"; mysql_close(); ?> Link to comment https://forums.phpfreaks.com/topic/143530-html-table-in-php/#findComment-753028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.