I\'ve been looking for an answer to this but haven\'t found it anywhere. Are calls to PDO::prepare() cached, or should I cache the result myself, i.e. if I do the following
It depends on your database driver. With MySQL, PDO will create a native prepared statement by default. You can disable it, if you want to use an actual query cache.
If you absolutely must execute the same query repeatedly, then yes, you'll want to keep that handle around. If you're using emulated prepared statements, then it makes no difference at all.