Okay - then identify the common properties and methods and create them in the base class, all other classes will extend it.
I think you may find a good example in Zend Framework's database class, or perhaps any other framework.
If the properties are stored in the base class as an array, assignment, overriding and dynamic construction of the SQL is possible.