Basic PDO Questions
| From: | Chris Drozdowski | Date: | Tue, 28 Feb 2006 22:48:36 +0000 |
| Subject: | Basic PDO Questions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-231239@lists.php.net to get a copy of this message | ||
I have a three quick PDO questions.
1) If a PDOStatement is created within a function or method, is it's server result set connection is automatically freed up when the function returns (I assume so, but want to make sure)?
2) Does setting a PDOStatement to null (PDOStatement = null) terminate the server result set connection (I assume so, but want to make sure)?
3) The documentation for PDO::quote encourages us to use prepared statements over the PDO::query() or PDO::exec() methods citing the economy and portability of prepared statements. For queries that will run only once, is there significantly more overhead using prepared statements rather than the PDO::query() or PDO::exec() methods? I know that that's kind of an unclear/subjective question, but I just don't know how to state it better.
Thanks,
Chris D