the code is correct, that will prevent blank entries from being added to the database.
In the body of the page, add todays date and upload it again to make sure the changes are being uploaded to the server correctly. When you load the page in the browser you should the data on the page to indicate that the code changes are making it up to the server before testing.