[eluser]Nick_MyShuitings[/eluser]
K.
1) You are not using AR... remember that you are just using the database class... (this is good... its quicker to write the SQL)
2) You should use query bindings for your variables, check the user guide
3) Just add this "... count(*) as amount..." and then return $query->row();