NYCPHP Meetup

NYPHP.org

[nycphp-talk] Writing Database Agnostic Code

Daniel Convissor danielc at analysisandsolutions.com
Thu Feb 15 11:14:45 EST 2007


Hi Brian:

On Wed, Feb 14, 2007 at 10:19:09AM -0500, Brian Dailey wrote:

> different database backends without significant (or maybe any) changes to
> your code. Pear::DB seems to really do a good job with this. However...

The new PEAR MDB2 package does an even better job.  Deals with building 
schemas nicely too.


> In the past, I've always used MySQL or Oracle, but mostly MySQL. Each SQL
> distribution has its own peculiar ways of doing some things, and I know that
> using some of the MySQL functions makes the code far easier to write and
> also optimizes the speed of the query.

In general, good SQL is good SQL, no matter what the platform is.

The question you need to face is how important performance is vs how 
important portability is.  The answer depends on what you're doing.

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list