Is a query inside mysql IF clause allowed?
You have a syntax error

This is not the right SQL for getting the count

Select COUNT(*) from `user` into c where `mobile_no` = mobileNo;


You do not put into c after the from clause. It goes before it.

Therefore, this is correct SQL syntax

Select COUNT(*) into c from `user` where `mobile_no` = mobileNo;


Give it a Try !!!