suttercain Posted February 20, 2007 Share Posted February 20, 2007 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. Quote Link to comment Share on other sites More sharing options...
Balmung-San Posted February 20, 2007 Share Posted February 20, 2007 echo <<<EOTABLE </table> EOTABLE; You're missing the EOTABLE; Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 20, 2007 Share Posted February 20, 2007 You never close your heredoc of EOTABLE Whoops, didn't preview Quote Link to comment Share on other sites More sharing options...
suttercain Posted February 20, 2007 Author Share Posted February 20, 2007 Doh!... thanks you two. 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.