so I changed the config stuff to:

global $db;

// Define all config values
$configuration_query = $db->Execute('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while (!$configuration_query->EOF)
{

define($configuration->fields['cfgKey'], $configuration->fields['cfgValue']);
$configuration_query->MoveNext();

}

I get no errors and no data which may not be due to this but to something that comes after. Can someone tell me if the code above should work?