make queries mysql compatible