First
Turn on error reporting by putting this at the top of each php file that you work with or some kind of configuration file (config.php utilities.inc.php):
[php]/* Turn on error reporting */
ini_set(‘display_errors’, 1);
ini_set(‘display_startup_errors’, 1);
error_reporting(-1);[/php]
Second
Try to put most of your php above your html instead of sprinkling throughout the the HTML, having one php line amongst the HTML when it could be included in the php code to me is kind of silly…well that’s my opinion. Most PHP programmers try to put most of the php above the HTML, but there are times when you do have to intermingle among the HTML. It becomes pretty obvious after awhile when the need to do that.
Third
Try to stop using mysql and use either mysqli or PDO (My Recommendation) for mysql is obsolete, it probably won’t work with PHP 7.0: