PHP, Python, Ruby application with multiple RDBMS
If you want to leverage the bells and whistles of various RDBMSes, you can certainly do it.  Just apply standard OO Principles.  Figure out what kind of API your persistence layer will need to provide.  
You'll end up writing a set of isomorphic persistence adapter classes.  From the perspective of your model code (which will be calling adapter methods to load and store data), these classes are identical.  Writing good test coverage should be easy, and good tests will make life a lot easier.  Deciding how much abstraction is provided by the persistence adapters is the trickiest part, and is largely application-specific.
As for whether this is worth the trouble: it depends.  It's a good exercise if you've never done it before.  It may be premature if you don't actually know for sure what your target databases are.  
A good strategy might be to implement two persistence adapters to start.  Let's say you expect the most common back end will be MySQL.  Implement one adapter tuned for MySQL.  Implement a second that uses your database abstraction library of choice, and uses only standard and widely available SQL features.  Now you've got support for a ton of back ends (everything supported by your abstraction library of choice), plus tuned support for mySQL.  If you decide you then want to provide an optimized adapter from Oracle, you can implement it at your leisure, and you'll know that your application can support swappable database back-ends.
I start feeling old fashioned when I see all these SQL generating database abstraction layers and all those ORMs out there, although I am far from being old. I understand the need for them, but their use spreads to places they normally don't belong to.
I firmly believe that using database abstraction layers for SQL generation is not the right way of writing database applications that should run on multiple database engines, especially when you throw in really expensive databases like Oracle. And this is more or less global, it doesn't apply to only a few languages.
Just a simple example, using query pagination and insertion: when using Oracle one could use the FIRST_ROWS and APPEND hints(where appropriate). Going to advanced examples I could mention putting in the database lots of Stored Procedures/Packages where it makes sense. And those are different for every RDBMS.
By using only a limited set of features, commonly available to many RDBMS one doesn't exploit the possibilities that those expensive and advanced database engines have to offers.
So getting back to the heart of the question: how do you develop PHP, Python, Ruby etc. applications that should run on multiple database engines?
I am especially interested hearing how you separate/use the queries that are especially written for running on a single RDBMS. Say you've got a statement that should run on 3 RDBMS: Oracle, DB2 and Sql Server and for each of these you write a separate SQL statement in order to make use of all features this RDBMS has to offer. How do you do it?
Letting this aside, what is you opinion walking this path? Is it worth it in your experience? Why? Why not?