Home arrow MySQL arrow Page 6 - PHP and Databases for the Lazy Sod

PHP and Databases for the Lazy Sod

In this article Justin explains his ezSQL utility, which reduces code and development time for database operations in PHP. This is great for the lazy sod...and everyone else.

Author Info:
By: Justin Vincent
Rating: 4 stars4 stars4 stars4 stars4 stars / 20
January 19, 2003
  1. · PHP and Databases for the Lazy Sod
  2. · Atomic Operations
  3. · Use PHP Functions not DB Functions!
  4. · Abstraction
  5. · Getting Even Lazier
  6. · Conclusion

print this article

PHP and Databases for the Lazy Sod - Conclusion
(Page 6 of 6 )

In this article we have spoken about the benefits of atomic operations, database abstraction and the use of classes.

atomic operations - We have converted the usual gunk of working with databases into a small number of key functions that do no less and no more than needed.

database abstraction - We have created a new set of functions that are entirely database independent (simply by switching one include file). Even better, these new functions require much less code than traditional methods of working with databases (due to our atomic operation implementation).

classes - We have wrapped all of the above up into a nice, easy to use, class/object. This is handy because it allows us to do things like easily manage two concurrent server connections (should we so wish) as well as cache results and offers us neat functions that won't get confused with other global scope functions.

Final Note

If you would like to see more examples of how to work with the class I've written (ezSQL) and how it can make your life easier, just go and have a look at http://php.justinvincent.com.

For a full-blown example of a busy website built using all the above concepts and the ezSQL class, visit http://vip.channel.ac.

It is a collaborative environment where about 2700 users post News, Pictures, Links and FAQs. It also has busy Forums and Live chat. It took about two months to build from scratch (no external scripts or software were used).

It gets approximately 95,000 hits to the mySQL database per day (all via ezSQL) and it runs like a charm.

If you would like to help by porting ezSQL to another database platform please feel free to do so and mail me the code (justin@visunet.ie).

I will include it in any future distributions. As stated, the only functions you need to change are $db->db, $db->select and $db->query. At the time of writing this article, ezSQL is available for mySQL and Oracle8.

The support file for this article can be found at http://php.justinvincent.com.
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.

blog comments powered by Disqus

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials