Speaking about SQL Injection.
Right now, I do the following for my website.
- Sanitize (any) parameters in query with mysql_real_escape_string().
- Integer data goes intval().
- Query with an user which has ALL PREVILIGIES.
Question 1: Does it prevent SQL Injection alone?
Also, I'm thinking about doing following.
Instead of using the query with all previligied user, I want to create an user for each task, like update, delete, select, drop etc.
When doing query, I can select which user to use like
$database->selectUser('SELECT')->runQuery('query');
Question 2: Would this help me on security? Does it worth doing it?