mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-10 15:54:01 +02:00
Merge pull request #156 from briannesbitt/patch-3
Added small paragraph on connections
This commit is contained in:
@@ -54,6 +54,14 @@ database preventing potential SQL injection attacks.
|
||||
|
||||
* [Learn about PDO][1]
|
||||
|
||||
You should also be aware that database connections use up resources and it was not unheard-of to have resources
|
||||
exhausted if connections were not implicitly closed, however this was more common in other languages. Using PDO you
|
||||
can implicitly close the connection by destroying the object by ensuring all remaining references to it are deleted,
|
||||
ie. set to NULL. If you don't do this explicitly, PHP will automatically close the connection when your script ends
|
||||
unless of course you are using persistent connections.
|
||||
|
||||
* [Learn about PDO connections][5]
|
||||
|
||||
## Abstraction Layers
|
||||
|
||||
Many frameworks provide their own abstraction layer which may or may not sit on top of PDO. These will often emulate features for
|
||||
@@ -71,6 +79,7 @@ Some abstraction layers have been built using the PSR-0 namespace standard so ca
|
||||
[2]: http://www.doctrine-project.org/projects/dbal.html
|
||||
[3]: http://framework.zend.com/manual/en/zend.db.html
|
||||
[4]: http://packages.zendframework.com/docs/latest/manual/en/index.html#zend-db
|
||||
[5]: http://php.net/manual/en/pdo.connections.php
|
||||
|
||||
[mysql]: http://uk.php.net/mysql
|
||||
[mysqli]: http://uk.php.net/mysqli
|
||||
|
Reference in New Issue
Block a user