I'm trying to learn how to use PDO and I need help understanding something.
I keep reading that one of the biggest benefits of using PDO is that a it is much more efficient than mysql_*
when making similar queries over and over again. I need to make a query that is exactly the same, except that the bound parameters change each time (but the structure of the query is the same). So, here's my question:
Should I call PDO::prepare()
once and then inside my loop call execute()
(passing the parameters array), or should I be calling PDO::preprare()
every time the loop runs?
Thanks!