コード例 #1
0
ファイル: gpt_pro.php プロジェクト: codethics/proteoerp
 function cargamdb()
 {
     $path = reduce_double_slashes(FCPATH . '/uploads/traspasos');
     $dirlocal = $path . '/gpt.mdb';
     $mdb = mdb_open($dirlocal);
     if ($mdb === false) {
         return false;
     }
     //$tablas=mdb_tables($mdb);
     $tablas = array('pro');
     foreach ($tablas as $tabla) {
         //echo $tabla.br();
         $sistab = "gpt_{$tabla}";
         $this->db->simple_query("TRUNCATE {$sistab}");
         $tbl = mdb_table_open($mdb, $tabla);
         if ($tbl === false) {
             continue;
         }
         while ($row = mdb_fetch_assoc($tbl)) {
             $sql = $this->db->insert_string($sistab, $row);
             $ban = $this->db->simple_query($sql);
             if ($ban == false) {
                 $error++;
                 memowrite($sql, 'gpt_prod');
             }
         }
     }
 }
コード例 #2
0
ファイル: script9.php プロジェクト: SandyS1/presentations
<?php

$db = mdb_open("test.mdb");
foreach (mdb_tables($db) as $name) {
    echo "{$name}:\n";
    $tab = mdb_table_open($db, $name);
    print_r(mdb_table_indexes($tab));
    mdb_table_close($tab);
    echo "\n\n";
}
mdb_close($db);