Hallo
ich möchte in meiner Extension eine Access Datenbank kontaktieren und abfragen. Die Verbindung wird zwar aufgebaut, aber bei der Abfrage scheint es einige Probleme zu geben.
Mein Code der Main-Funktion:
function main($content,$conf) {
$this->pi_initPIflexForm(); // Init FlexForm configuration for plugin
$this->conf=$conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$content="<p>TEST </p> ";
$dbh = odbc_connect('prosa', 'Username', 'Passwort', SQL_CUR_USE_ODBC) or die("Keine Verbindung zur Datenbank");
$content.= "<p>Datenbankantwort: ".$dbh."</p>";
$res = odbc_exec($dbh, 'SELECT Prosa_Klappentext FROM Prosa WHERE Prosa_ElternID = 1349');
$content.= "<p>Result SQL: ".$res."</p>";
$content.= odbc_result_all($res);
$content.=odbc_num_rows($res);
echo odbc_errormsg();
odbc_close_all();
$content.='<p>Produkt ID: '.$ffCode = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'idprodukt').'</p>
';
return $this->pi_wrapInBaseClass($content);
}
}
Als Fehler wird mir dann auf der Webseite folgendes ausgegeben:
No rows found
Warning: Cannot modify header information - headers already sent by (output started at E:\htdocs\site\typo3conf\ext\sma_prosa_produkt\pi1\class.tx_smaprosaprodukt_pi1.php:51) in E:\htdocs\site\tslib\class.tslib_fe.php on line 2402
hat das schon mal jemand von euch hinbekommen?