SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`empName` is not null limit 1' at line 1 (SQL: select * from `emp_data` where empDob `empName` is not null limit 1)
@Sinnbeck I want to count the number of null columns for each row, But your query returns 1 when all of them are NULL, and returns 0 for any of them are not NULL. But I want to count the number of null columns for a single row.
@Sinnbeck Basically, During registration every user have to fill 10 mandatory fields, and 30 non-mandatory fields. After registering the user I redirect to the user dashboard, here I want to show a message which is "you complete x% of your profile, please complete the rest registration process". Now I need to find the x.
I calculate the total number of NULL fields and do simple calculations and show the x.
@Sinnbeck Okay, This is a classic way but I actually looking for Laravel prebuild query or function. But in this way, I can achieve my output also, Thanks :).