Subversion-Projekte lars-tiefland.em_wm

Revision

Revision 81 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 81 Revision 114
Zeile 1... Zeile 1...
1
<?
1
<?
2
	require_once("Config.php");
2
    require_once ( "Config.php" );
3
	require "DB.php";
3
    require "DB.php";
Zeile 4... Zeile 4...
4
 
4
 
5
	$cfg=new Config();
5
    $cfg = new Config();
-
 
6
    $db_conf = $cfg->parseConfig( "include/config.xml", "XML", array("name" =>
6
	$db_conf=$cfg->parseConfig("include/config.xml","XML",array("name"=>"db"));
7
        "db") );
7
	$db_conf=$db_conf->toArray();
8
    $db_conf = $db_conf->toArray();
8
	foreach ($db_conf["root"]["db"] as $k => $v)
9
    foreach ( $db_conf["root"]["db"] as $k => $v )
9
	{
10
    {
10
		$$k=$v;
11
        $$k = $v;
11
	}
12
    }
12
	$dsn="$db_type://$db_user:$db_pass@$db_host/$db_name";
13
    $dsn = "$db_type://$db_user:$db_pass@$db_host/$db_name";
13
	$db=DB::connect($dsn,array());
14
    $db = DB::connect( $dsn, array() );
14
	if ( $res=(true == DB::isError($db)))
15
    if ( $res = (true == DB::isError($db)) )
15
	{
16
    {
16
		$smarty->assign("meld", "Es ist ein Fehler aufgetreten!");
17
        $smarty->assign( "meld", "Es ist ein Fehler aufgetreten!" );
17
		$smarty->assign("db_meld",$db->getMessage());
18
        $smarty->assign( "db_meld", $db->getMessage() );
18
		$smarty->assign("error",true);
19
        $smarty->assign( "error", true );
19
		$smarty->display("meld.tpl");
20
        $smarty->display( "meld.tpl" );
20
		exit;
21
        exit;
21
	}
22
    }
22
	$r2=$db->query("SET CHARACTER SET latin1");
23
    $r2 = $db->query( "SET CHARACTER SET latin1" );
23
	$db->setFetchMode(DB_FETCHMODE_ASSOC);
24
    $db->setFetchMode( DB_FETCHMODE_ASSOC );