I didn't add the code formatting so my text was unclear. Sorry for that. Add:
error_reporting (E_ALL);
at the top of your code to set error output to all....actually, you'll want that for only debugging. It will output all sorts of warnings, messages, and errors and clutter your page from...