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 idSubCateg= ORDER BY data desc' at line 1 Erro na execução do comando SQL, id=Resource id #4
SQL:SELECT * from foto where idCateg= and idSubCateg= ORDER BY data desc