Translations:Secure coding guidelines/42/en
From Joomla! Documentation
// For SQL data types: FLOAT, DOUBLE $query = 'SELECT * FROM #__table WHERE `id`=' . (float) $id; </source> It's a good idea to get into the habit of always typecasting integers like this even if the variable was previously obtained using JInput->getInt. Further information on SQL injection attacks can be found here: http://php.net/manual/en/security.database.sql-injection.php and here: Retrieving_request_data_using_JInput#Getting_Values.