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 Quote Link to comment 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>"; Quote Link to comment 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(); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.