Have you considered putting the select in a paragraph and copying it so there are two paragraphs: one including your table and one not. then you could call the paragraphs depending on the value of $include_tab_x.