/dev/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/trunk

« back to all changes in this revision

Viewing changes to system/convert.php.bk

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-02 10:23:22 UTC
  • Revision ID: csa@dside.dyndns.org-20080402102322-okib92sicg2dx3o3
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?
 
2
 
 
3
/*
 
4
    $source = array (
 
5
        "driver" => "dblib",
 
6
        "host" => "192.168.25.6",
 
7
        "port" => 10387, // could be found trough mmc console
 
8
        "user" => "csa",
 
9
        "pass" => "midgaard",
 
10
        "database" => array ("IK016032_KATRIN#Hauptpektrometer_TLG_F_200707252200")
 
11
    );
 
12
*/
 
13
 
 
14
    $source = array (
 
15
        "driver" => "dblib",
 
16
        "host" => "192.168.25.7",
 
17
        "port" => 1066, // could be found trough mmc console
 
18
        "user" => "zeus",
 
19
        "pass" => "zues",
 
20
        "database" => array ("CC_ExternalBrowsing")
 
21
    );
 
22
    
 
23
/*
 
24
specify range
 
25
*/
 
26
 
 
27
 
 
28
function ConvertWinCC(&$source, $db) {
 
29
    $con = mssql_connect ("WinCC", "zeus", "zeus");
 
30
    mssql_select_db("CC_ExternalBrowsing", $con);
 
31
    $res = mssql_query("SELECT * FROM TagCompressed");
 
32
    while ($row = mssql_fetch_array($result)){
 
33
        echo $row['BinValues'];
 
34
    }
 
35
    unset($con);
 
36
 
 
37
/*    try {
 
38
        $dbh = new PDO ($source['driver'] . ":host=" . $source['host'] . ($source['port']?(":" . $source['port']):"") . ";dbname=" . $db, $source['user'], $source['pass']);
 
39
        $res = $dbh->query("SELECT * from TagCompressed");
 
40
        foreach ($res as $row) {
 
41
//          print_r($row);
 
42
            echo($row['BinValues']);
 
43
            exit;
 
44
        }
 
45
 
 
46
        unset($dbh);    
 
47
    } catch (PDOException $e) {
 
48
        echo "PDO Exception: " . $e->getMessage() . "<br/>";
 
49
        exit;
 
50
    }
 
51
*/        
 
52
}
 
53
 
 
54
 
 
55
foreach ($source['database'] as $db) {
 
56
    ConvertWinCC($source, $db);
 
57
}
 
58
 
 
59
?>
 
 
b'\\ No newline at end of file'