SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and (stato="Q1" or stato="Q2") order by prn_o,tipo,sex,cat,T1_N_N,T2_N_N,numero' at line 1