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. Link to comment https://forums.phpfreaks.com/topic/39345-solved-parse-error-parse-error-unexpected-end-in-c/ 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; Link to comment https://forums.phpfreaks.com/topic/39345-solved-parse-error-parse-error-unexpected-end-in-c/#findComment-189760 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 Link to comment https://forums.phpfreaks.com/topic/39345-solved-parse-error-parse-error-unexpected-end-in-c/#findComment-189762 Share on other sites More sharing options...
suttercain Posted February 20, 2007 Author Share Posted February 20, 2007 Doh!... thanks you two. Link to comment https://forums.phpfreaks.com/topic/39345-solved-parse-error-parse-error-unexpected-end-in-c/#findComment-189764 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.