Oh the code works fine as I tested it in another folder in localhost. I don't need help with the script itself. I am placing this script in another .php file. It's not in an html page. Other php scripts in the .php file all compile correctly, while the one I am having issue with is not compiling correctly even though there is nothing wrong with the script at all.
For better understanding, here is a sample:
- Code: Select all
<?php PHP CODE IS HERE. NO ERRORS AT ALL. ?>
<table>DISPLAY INFO FROM PHP SCRIPT</table>
I placed this entire script into a spot in the middle of my webpage. The php script is correct even though it still shows a parse error. However, when I placed the PHP script at the top of the webpage, it worked. So why does it work when its at the top and doesnt work when I place it in the middle with the <table> script? The end of the PHP script has mysqli_close($conn);. Should this code be placed at the bottom of the .php page so the script will work in the middle?