Esempio n. 1
0
    shopFehler("", $shop->getDebugInfo());
    die($shop->getDebugInfo());
}
/****************************************************
* ERPverbindung aufbauen
****************************************************/
$erp = DB::connect($ERPdns);
if (!$erp) {
    shopFehler("", $erp->getDebugInfo());
}
if (DB::isError($erp)) {
    $nun = date("Y-m-d H:i:s");
    if ($log) {
        fputs($log, $nun . ": ERP-Connect\n");
    }
    shopFehler("", $erp->getDebugInfo());
    die($erp->getDebugInfo());
} else {
    $erp->autoCommit(true);
}
/****************************************************
* SQL-Befehle absetzen
****************************************************/
function query($db, $sql, $function = "--")
{
    $nun = date("d.m.y H:i:s");
    //if ($db<>"shop") { echo "$sql!$db!<br>"; flush(); };
    if ($GLOBALS["log"]) {
        fputs($GLOBALS["log"], $nun . ": " . $function . "\n" . $sql . "\n");
    }
    $rc = $GLOBALS[$db]->query($sql);
Esempio n. 2
0
if (DB::isError($erp)) {
	$nun=date("Y-m-d H:i:s");
	if ($log) fputs($log,$nun.": ERP-Connect\n");
	shopFehler("",$erp->getDebugInfo());
	die ($erp->getDebugInfo());
} else {
	$erp->autoCommit(true);
};*/
$options = array('result_buffering' => false,);
$erp = MDB2::factory($ERPdns,$options);
//echo "<pre>"; print_r($erp); echo "</pre>";
if (!$erp) shopFehler("",$erp->getMessage());
if (PEAR::isError($erp)) {
        $nun=date("Y-m-d H:i:s");
        if ($log) fputs($log,$nun.": ERP-Connect\n");
        shopFehler("",$erp->getMessage());
        die ($erp->getMessage());
} else {
        if ($erp->autocommit) $erp->autocommit();
};

if ($SHOPchar and ExportMode != "1") {
    $erp->setCharset($SHOPchar);
} 
$erp->setFetchMode(MDB2_FETCHMODE_ASSOC);



/****************************************************
* SQL-Befehle absetzen
****************************************************/