Solved

What should I use PDO or ezSQL?

Posted on 2010-11-26
3
1,481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 34218345
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
ID: 34218395
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
ID: 34229480
Thanks for the advice guys, looks like I shall be using PDO then!
0

Featured Post

Webinar: MariaDB® Server 10.2: The Complete Guide

Join Percona’s Chief Evangelist, Colin Charles as he presents MariaDB Server 10.2: The Complete Guide on Tuesday, June 27, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
The viewer will learn how to count occurrences of each item in an array.

695 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