I would recommend using PDO (PHP Data Objects) to run the parameterized SQL queries.
Not only does this protect against the SQL injection, but it also speeds up the queries.
And by using PDO rather than mysql_, mysqli_, and pgsql_ functions, you make your application a little more abstracted from the database, in the rare occurrence that you have to switch database providers.
If you want to learn more about SQL, Check out this SQL Certification by Intellipaat.