Fixed a wrong SQL query. Everything works perfect now!