I love using PDO in PHP but i don't like bind because there is addition of codes etc.. But we cannot ignore the SQL injection and other security holes.
I use this PHP wrapper class PHP PDO Wrapper Class
I heard escaping greatly prevents from SQL injection (is it correct)?
i heard doing HTML special chars completely don't prevent SQL injection?
Can i get the way to escape the data that i get from POST ?
For example i use to insert in database like this using run statement (Using PHP wrapper class)
$firstname=$_POST["first_name"];
and many more variables
global $db;
$db->run(sprintf("INSERT INTO users (UserGroup, UserEmail, UserName, UserToken, UserFirstName, UserLastName, UserPassword, Verified, SignupDate, UserIP) VALUES ('1', '%s', '%s', '%s', '%s', '%s', '%s', 'Y', '%s', '%s')", $email, $username, md5(time()*rand(1, 9999)),$firstname, $lastname, $password, time(),$_SERVER[REMOTE_ADDR]));
Is this above code vulnerable to sql injection and are there any security holes