All the queries for the bank table must use the same WHERE … clause, so that they match and operate on the same set of data.
The common part of the query, starting with the FROM term, any JOINs, any WHERE clause, any GROUP BY clause, and any HAVING clause should be built once, in a php variable, then that variable should be used when building any sql query that needs it.