Minor fix to prevent addition of a blank Hanna code
Fix issue with a mysqli query