Jump to content

[SOLVED] Parse error: parse error, unexpected $end in C:


suttercain

Recommended Posts

Getting the following error:

Parse error: parse error, unexpected $end in C:\wamp\www\PHP\test.php on line 38

 

The read this is usually caused by short tags, <? ?> or a missing curly bracket. But the code looks good as far as that:

 

<?php
$conn = new mysqli ('localhost', 'root', NULL, 'dbname');

$conn->query("SET NAMES 'utf8'");

$query_str = "SELECT * FROM dbname";
$result =@$conn->query($query_str);
if ($result === FALSE)
{
echo "You Failed!";
}
else
{
echo <<<EOM
<table>
<tr>
<td>ID</td>
<td>Year</td>
<td>Engine Family</td>
</tr>
EOM;
while (($row_data = @$result->fetch_assoc()) !==NULL)
{
echo <<<EOM
<tr>
<td>{$row_data['ID']}</td>
<td>{$row_data['YEAR']}</td>
<td>{$row_data['ENGFAM']}</td>
</tr>
EOM;
}
echo <<<EOTABLE
</table>

$result->close();
}
$conn->close();
?>

 

What am I missing?

 

Thank you.

 

 

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.