How to filter out the where clause in a query builder?

I'm building an dynamic application with a query builder that consists of four select lists where the user can enter the table, column, operator and attribute names. Now I also want the user to be able to do select ALL. So the user should have the option to only select the table, and column name(=ALL). But I don't know how to filter out the where clause then. This is my php script at the moment: