Solved

What should I use PDO or ezSQL?

Posted on 2010-11-26
3
1,427 Views
Last Modified: 2012-05-10
Should I be using PDO or ezSQL for database connections?

- What are the benefits of each?
- Which is the most efficient?
- Do they fix inconsistencies between different SQL implementations (for example, MySQL and MSSQL)?
0
Comment
Question by:numberkruncher
3 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 250 total points
Comment Utility
My belief is that whatever you choose should be considered a "permanent" choice, and you should write your programming to take advantage of the features of the SQL implementation.  In mySQL, REPLACE INTO is a good example.  It's not "standards compliant" but it works great for lots of things.

Efficiency of the engine is not usually of any importance to the efficiency of the application.  The biggest factors in app performance are data organization and indexes.  If your data relates in normalized, sensible ways you will be able to write efficient queries.

I usually have an abstraction layer of some sort, so that most of my table maintenance can be done with PUT and GET methods.  But most of my programming is SELECT related and there is not a lot of UPDATE work going on.  Not that it is intentional, just that my apps worked out that way.

All that said, I would choose PDO if you want.  Search the PHP.net web site for information about both PDO and ezSQL and you will see why!

Best regards, ~Ray
0
 
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 250 total points
Comment Utility
I would choose either PDO or MySQLi rather than a niche product. ezSQL is used on thousands of websites whereas PDO or MySQLi is measured in millions. My own bias would be MySQLi.

I agree with Ray's points about normalizing the data, but especially on INDEXing the data. Nothing makes a bigger difference then selecting proper indexes. We have solved more performance problems on EE through creating indexes on the database than just about any other measure I can think of.
0
 
LVL 13

Author Closing Comment

by:numberkruncher
Comment Utility
Thanks for the advice guys, looks like I shall be using PDO then!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
spacing 5 24
Select2 jquery help 9 41
Page showing diff display 4 14
mysql left join sentence 7 18
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo‚Ķ
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
The viewer will learn how to dynamically set the form action using jQuery.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now