Fixbug login for #145

The SQL Query is wrong.