This is more of a PHP issue. Check the variable $_SERVER, to see which domain the user comes from, and set the QA_MYSQL_TABLE_PREFIX accordingly. Other configuration can be set this way too. Somthing like this maybe:
$table_prefix = '';
switch ($_SERVER['HTTP_HOST']) {
case 'example.com':
$table_prefix = 'qa_org_';
break;
case 'example.com':
$table_prefix = 'qa_com';
break;
default:
// Handle error
}
define('QA_MYSQL_TABLE_PREFIX', $table_prefix);
You could even choose different databases like this
Hope it helps...