PDO PARAM_STR and length

I do not understand the length parameter in the instructions PDO PARAM_*.

Does the length indicate the number of characters required, or is it the maximum?

Example:

$sth->bindParam(2, $color, PDO::PARAM_STR, 12);

Is it required 12 characters or is it limited to 12 characters? Or do I completely understand what this is doing?

+5
source share
1 answer

This is an indicator of how much data you want to receive in the output parameter, the server will not send more than this.

So, to answer your question, this is more of a limitation than a requirement.

+5
source

All Articles