Understanding and Preventing SQL Injections