Hallo,
dies ist mein erster Versuch mit dbal. o.O
Ich möchte für den Newsletterversand Adressen aus Datensätzen einer externe Datenbank verwenden. Die Datenbankstruktur ist allerdings unterschiedlich! Also dachte ich ich, könne mit dbal die andere DB anzapfen und über das mapping die Zuordnungen anpassen. Aber irgentwie komme ich nicht klar, es will einfach nicht funktionieren. Wahrscheinlich fehlt mir noch das nötige Verständnis für dbal.
Ich würde mich über Hilfe sehr freuen!
Hier mein Code, den in der typo3conf/localconf.php angehängt habe:
// dfluess
$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array (
'_DEFAULT' => array (
'type' => 'native',
'config' => array(
'username' => '', // Set by default (overridden)
'password' => '', // Set by default (overridden)
'host' => '', // Set by default (overridden)
'database' => '', // Set by default (overridden)
)
),
'alternativeMySQLdb' => array (
'type' => 'native',
'config' => array(
'username' => 'p11508xxx',
'password' => 'xxxxxxxx',
'host' => 'xxxxxx.mydbserver.com',
'database' => 'usr_p11508xxx',
)
),
);
$TYPO3_CONF_VARS['EXTCONF']['dbal']['table2handlerKeys'] = array (
'tt_address' => 'alternativeMySQLdb',
);
$TYPO3_CONF_VARS['EXTCONF']['dbal']['mapping'] = array (
'externe_tabelle' => array (
'mapTableName' => 'tt_address',
'mapFieldNames' => array (
'id' => 'uid',
'IsActive' => 'pid',
'DateOfSubscription' => 'tstamp',
'u_EMail' => 'email'
)
)
);
// Debug einschalten
$TYPO3_CONF_VARS['EXTCONF']['dbal']['debugOptions'] = array(
'enabled' => TRUE, // Generally, enable debugging.
'printErrors' => TRUE, // Enable output of SQL errors after query executions.
'EXPLAIN' => 1, // EXPLAIN SELECT ...(Only on default handler)
'parseQuery' => 1, // Parsing queries, testing parsability (All queries)
'joinTables' => 1
);
Debug gibt nichts besonderes aus:
Time # of queries | Error | Time (ms) | Script
20-03-10 18:33 | 9 || 15 | typo3/mod.php
20-03-10 18:33 | 8 || 5 | typo3/mod.php
20-03-10 18:32 | 6 || 5 | typo3/ajax.php
20-03-10 18:31 | 6 || 5 | typo3/ajax.php
20-03-10 18:30 | 6 || 10 | typo3/ajax.php
20-03-10 18:29 | 6 || 31 | typo3/ajax.php
20-03-10 18:28 | 6 || 6 | typo3/ajax.php
20-03-10 18:27 | 6 || 8 | typo3/ajax.php
20-03-10 18:26 | 6 || 4 | typo3/ajax.php
20-03-10 18:25 | 6 || 9 | typo3/ajax.php
20-03-10 18:24 | 6 || 5 | typo3/ajax.php
20-03-10 18:23 | 6 || 3 | typo3/ajax.php
20-03-10 18:23 | 9 || 61 | typo3/mod.php
20-03-10 18:22 | 6 || 5 | typo3/ajax.php
20-03-10 18:22 | 8 || 26 | typo3/mod.php
20-03-10 18:22 | 115 || 267 | typo3/alt_doc.php
20-03-10 18:22 | 46 || 29 | typo3/db_list.php
20-03-10 18:22 | 25 || 52 | typo3/alt_doc.php
20-03-10 18:22 | 16 || 45 | typo3/db_new.php
20-03-10 18:22 | 11 || 8 | typo3/alt_db_navframe.php
20-03-10 18:22 | 46 || 116| typo3/db_list.php
20-03-10 18:22 | 7 || 16 | typo3/alt_mod_frameset.php
20-03-10 18:22 | 11 || 37 | typo3/mod.php
20-03-10 18:22 | 11 || 11 | typo3/alt_db_navframe.php
20-03-10 18:22 | 10 || 17 | typo3/alt_mod_frameset.php
20-03-10 18:22 | 48 || 70 | typo3/db_list.php
20-03-10 18:22 | 11 || 66 | typo3/tce_db.php
Kann mir jemand weiter Helfen?