[ticket/12718] Fix docblocks

PHPBB3-12718
[ticket/12718] Fix spacing and type casting

PHPBB3-12718
[ticket/12718] Use a separate variable for sql query

PHPBB3-12718