I am using PDOs first time on my project and have some confusions in my mind and wanted to clarify:
Everyone recommends PDOs because it prevents from SQL injection so
- Do we need to apply other functions before making query like
strip_tagsOR they aren't necessary with PDOs?
- Do we need to apply other functions before making query like
What is different betweeen
:usernameandusername?Example:
$stmt = $db->prepare("SELECT id FROM USERS WHERE username=:username); $stmt->bindParam(":username", $username); $stmt->bindParam("username", $username);Does this prevent from SQL injection?
PDO::PARAM_STRwhich is used as third parameter inbindParamstatementIs it necessary to close connection by setting connection object to null in end? like
$db = null;