SQL query no longer prints