Reputation: 73848
Does PDO::PARAM_INT
perform any function at all when used with $db->quote()
function? e.g. $db->quote($user['id'], PDO::PARAM_INT)
?
It seems like it is, because even string input will get passed trough. Not to mention that it keeps the quotes around the integer. Is there any reason why should I use it?
Upvotes: 5
Views: 1932
Reputation: 85802
It has no effect, since, after all, you are running the quote
function. It's only natural that it gets wrapped in quotes. PDO::PARAM_INT
is likely more important in other contexts, like prepared statements, where it is actually handled differently than strings.
quote
likely is more concerned with other data types that should not be quoted or should be quoted differently, like PDO::PARAM_BOOL
Upvotes: 3