CASE When Not working with varchar (default value null) in mysql.. please check the solution

By | October 15, 2015

create a table using the below sql statement

if we use the below mysql query output as like below

IFNULL example in myql,if case ,when in php,hire php developers

you can see the result with NULL value for the first_name field.

if you use the query as in a newformat ..with IFNULL condition it wil work. below query will work for you

SELECT id,case age when ” then ‘No Age’ else age
end as sudent_ages,IFNULL(first_name, ‘NO First Name’)as student_firstname
from students

IF NULL,case when examples in mysql,php developers