Does PDO::PARAM_STR filters the input from user?
Posted on 2014-10-20
The I was using the PDO function from php with prepare statements.
I have an input string like this: 'UPDATE tbl_1 Set city = :city and id = :id';
$city = 'Mongo';
$id = 3;
I've also have my bindParam() like this: bindParam(':city', $city, PDO::PARAM_STR);
and bindParam(':id', $id, PDO::PARAM_INT);
somehow I changed the PDO::PARAM_STR into PDO::PARAM_INT for bindParam(':city', $city, PDO::PARAM_STR) and the result from $city still works. I am wondering what does the PDO::PARAM_STR or the PDO::PARAM_INT do because it is not filtering out the input for me. Thanks.