Styles2304 Posted August 11, 2007 Share Posted August 11, 2007 Ok . . . this is my code: <?php $link = mysql_connect("localhost","username","password") or die(mysql_error()); mysql_select_db("mysql_database") or die(mysql_error()); $query = "SELECT EntryDate, Data " . "FROM Announcements"; $result = mysql_query($query, $link) or die(mysql_error()); $announcements = ' '; while ($row = mysql_fetch_array($result)) { $entrydate = $row['EntryDate']; $data = $row['Data']; $announcements .=<<<EOD <table with="100%" cellpading="0" cellspacing="0" border="1"> <tr> <td colspan="2"> <font class="h3"> $entrydate </font> </td> </tr> <tr> <td width="5"> </td> <td width=*> <font class="h3"> $data </font> </td> </tr> </table> EOD; } echo $announcements; ?> and it gives me this error: Parse error: syntax error, unexpected $end in /home/styles/public_html/phptest.php on line 47 Line 47 is the ?> Any idea what I'm doing wrong here? Link to comment https://forums.phpfreaks.com/topic/64448-solved-unexpected-end/ Share on other sites More sharing options...
lur Posted August 11, 2007 Share Posted August 11, 2007 http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc The closing identifier must begin in the first column of the line. Remove the spaces infront of "EOD;". Link to comment https://forums.phpfreaks.com/topic/64448-solved-unexpected-end/#findComment-321326 Share on other sites More sharing options...
Styles2304 Posted August 11, 2007 Author Share Posted August 11, 2007 :: sigh :: thanks, it's always so simple. Link to comment https://forums.phpfreaks.com/topic/64448-solved-unexpected-end/#findComment-321327 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.