I'm wondering if PDO prepared statements can save me from SQL Injection ?
Example: $DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
The data I want to insert
$data = array( 'name' => $userInput_1, 'addr' => $userInput_2, 'city' => $userinput_3 );
For instance $userInput_2 is SLQ INJECTION.
$STH = $DBH->("INSERT INTO folks (name, addr, city) value (:name, :addr, :city)");
What will happen after execute in this case ?
$STH->execute($data);
Thank You!