Jump to content

[SOLVED] unexpected $end ?


Styles2304

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.