Visit the FAQ noted below and look under the section for "SSI" you will find various ways people have used SSI with their databases.
Using the user friendly short/long mod I use several SSI calls for my headers, footers, etc. within the script.
Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/