Fix SQL injection vulnerability

Verify that any $id used is an integer before to use it directly into database