Fix bug on empty criteria MySQL