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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.