Brian Dailey wrote:
A lot of the books and other material that I've been reading talk about database abstraction - developing your application so that you can use different database backends without significant (or maybe any) changes to your code. Pear::DB seems to really do a good job with this. However...

There are two levels of this.


At the first level, you to do basic SQL passthrough without worrying about whether to use pg_fetch_array() or mysql_fetch_array().


At the second level you need to hide the fact that some SQL variants want to say "SELECT * FIRST 10 FROM .... " while others insist on "SELECT * FROM... ORDER BY x limit 5". The usual solution here is to create replacement functions that build your SELECT statements for you.





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.

So my question boils down to this: how does one balance writing code that works regardless of the backend and still keep things optimized for speed and clarity? Are there any generalized tips that any of you can share from your experiences?
------------------------------------------------------------------------

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

begin:vcard
fn:Kenneth  Downs
n:Downs;Kenneth 
adr;dom:;;347 Main Street;East Setauket;NY;11733
email;internet:[EMAIL PROTECTED]
tel;work:631-689-7200
tel;fax:631-689-0527
tel;cell:631-379-0010
x-mozilla-html:FALSE
url:http://www.secdat.com
version:2.1
end:vcard

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to