1
Safety and performance is extremely important for any application, so some techniques are used for development.
One of them is the bind
to perform any type of query in your database.
When you do it for example:
$CEP->nomeBairro($nomeBairro);
$CEP->inserirCepAtendido();
and in your class you have an Insert with bindParam
, I know that this type of parameterization is extremely advantageous in the security issue.
It struck me a curiosity, this approach, has as benefit only safety or other benefits?
Another advantage would be not having to mix the variables or values (bindValue) in the middle of the query, but it is relative how much it is advantage, otherwise it is only a facilitator to avoid having to do things "patched" in the middle, your code there for me does not make sense, nor does OO make much sense in PHP, most use pq think beautiful and not for real need, but nor will I get into this merit of debate, the point I want to raise are: "security guard", it is not well that it was not security, but security as they often used wrong ...
– Guilherme Nascimento
... and this comment from @Acco
– Guilherme Nascimento