Hello mutasadiq iqbal
Your question is not probably one which can be resolved as it's lengthy code and we do not know what the exact data all the involved variables holds.
But let me provide a guideline,
1. please debug your code carefully
2. check value of "b" variable, it might be not allowing to pass your criteria in for loop where you check "k<b" inside search method
3. check all values held in array "customer_name", it is possible that it is not properly derived and does not hold target value you want to compare with the "name"variable
4. check value held in variable "name" itself, it is possible that it is not containing expected value to compare
In short, Your best solution is to debug code carefully, and don't lose courage until you fix it!
Happy Coding! :)