The code I've shown you in this article may or may not work exactly from your cut-and-paste. However, I use this same structure for writing all the Oracle connectivity on my current projects...so I know it works.
By abstracting the authentication to a single location, I can manage my application's connection strings much easier.
By using the 'query' function for encapsulating all queries, I gain a significant speed up in application development time. It also helps to keep the code broken into distinct Classes or 'objects'.
When it comes time to hunting down problems and making enhancements, you'll be glad you abstracted the complicated portions of your PHP code so that you can concentrate on the true business logic.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |