|
FAQ
- Q: What is PDO?
- A: PDO provides a unified client interface to databases using PHP. It only provides a limited amount of abstraction (mainly prepare/execute, errors). On top of the unified methods each driver can implement its own native RDBMS specific set of methods. It interfaces with the given RDBMS on the same level as the equivalent currently available database extensions and fully exploits all of the 5.x OO features to provide performance at least as high or higher.
- Q: What are the limitations of PDO?
- A: PDO currently does not provide all of the functionality of the current equivalent extension. All missing functionality will likely be implemented over time. PDO also doesnt provide things like SQL abstraction like LIMIT emulation, full datatype handling (LOB is planned), schema reading (result set introspection is supported however) or schema manipulation. Therefore PDO is not a replacement for DB, MDB[2], ADODB or Creole but is likely to actually complement future versions.
- Q: When did PDO development begin?
- A: The first meetings were held at LinuxTag? 2003. Since then a considerable number of people have worked on specc'ing out PDO, defining its API and coding the actual infrastructure and drivers.
- Q: What influenced the design of PDO?
- A: The API is designed for ease of use while leveraging the improved OO-Model of PHP 5.x. The APi is inspired by the existing database extensions, PERL DBI, the various PEAR abstraction layers and common sense.
- Q: Why doesn't PDO provide a way to retrieve the number of rows in a result set? Does PDO support buffered result sets? Why does PDO provide a way to seek to a specific row?
- A: PDO provides only unbuffered result sets. This means that when using PDO the client will immediatly allow you to process the returned rows even if the entire result sets has not been assembled by the database. Also the client will only receive the rows that are actually fetched. This will improve the memory requirements considerably with large result sets. If however you require the convinience of being able to jump around in the result set or you need to get the number of rows in the result set you can use the fetchAll() method to fetch the entire result set. This will fetch the entire result set into an array. Also often when people think they need to check the number of rows in a result set they actually just want to know if there are any rows in the result set. By restucturing the relevant code it should be easily possible to simply issue a first fetch and get the same information in a more efficient manner.
- Q: Can you extend PDO and PDOStatement?
This site powered by YaWiki 0.22 beta.
| No user comments exist for this page. |
Add A Comment
Your comment will be added immediately; please check your comments, and be nice. :-)
Please use plain text only; HTML and PHP code will be converted to entities.
Your email address will be obfuscated with [AT] and [DOT] after you post your comment.
|
|