I'm writing the following code and want to know if it's still necessary to escape my variables when using bindParam()
.
$usernameCheckQuery = $db->getConnection()->prepare("SELECT username FROM users WHERE username = :username");
$usernameCheckQuery->bindParam(":username", $data['username'], PDO::PARAM_STR);
$usernameCheckQuery->execute();
I've read on some places that it's not necessary and others that say it is. Thanks for any help.