When you bind parameters to SQL statement, you can provide parameter type like PDO::PARAM_STR
. If you don't, type defaults to PDO::PARAM_STR
. What can be the reasons to specifically set the type of each parameter? PDO::PARAM_STR works with any parameter as I know at least in MySQL. I think even with PDO::PARAM_STR can be used even with BLOB columns.
PDO::PARAM_STR does not introduce any SQL injection because you still have prepared queries.