Trouble with checking empty value

So, i have some trouble with checking empty value. How can i fix this problem? I want to check if category_name exist in database (its working), and i want to check if input is empty (thats not work). Here is my code: