当前位置: 首页>>代码示例>>PHP>>正文


PHP odbc_tables函数代码示例

本文整理汇总了PHP中odbc_tables函数的典型用法代码示例。如果您正苦于以下问题:PHP odbc_tables函数的具体用法?PHP odbc_tables怎么用?PHP odbc_tables使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了odbc_tables函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getTables

		/** Returns a full list of tables in an array. */
		function getTables(){
			if ($this->getConn()){
				$return = array();
				
				if ($this->getType() == "mysql"){
					$f_gt = $this->query("SHOW TABLE STATUS", $this->conn);
					while($d_gt = $this->query_fetch_assoc($f_gt)){
						$return[] = array(
							"name" => $d_gt[Name],
							"engine" => $d_gt[Engine],
							"collation" => $d_gt[Collation],
							"rows" => $d_gt[Rows]
						);
					}
					
					return $return;
				}elseif($this->getType() == "pgsql"){
					$f_gt = $this->query("SELECT relname FROM pg_stat_user_tables ORDER BY relname");
					while($d_gt = $this->query_fetch_assoc($f_gt)){
						$return[] = array(
							"name" => $d_gt[relname],
							"engine" => "pgsql",
							"collation" => "pgsql"
						);
					}
					
					return $return;
				}elseif($this->getType() == "sqlite" || $this->getType() == "sqlite3"){
					$f_gt = $this->query("SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name");
					while($d_gt = $this->query_fetch_assoc($f_gt)){
						if ($d_gt["name"] != "sqlite_sequence"){
							$return[] = array(
								"name" => $d_gt[name],
								"engine" => "sqlite",
								"collation" => "sqlite"
							);
						}
					}
					
					return $return;
				}elseif($this->getType() == "access"){
					$f_gt = odbc_tables($this->conn);
					while($d_gt = odbc_fetch_array($f_gt)){
						if ($d_gt[TABLE_TYPE] == "TABLE"){
							$return[] = array(
								"name" => $d_gt[TABLE_NAME],
								"engine" => "access",
								"collation" => "access"
							);
						}
					}
					
					return $return;
				}else{
					throw new Exception("Not a valid type: " . $this->getType());
				}
			}
		}
开发者ID:kaspernj,项目名称:knjphpfw,代码行数:59,代码来源:class_dbconn_tables.php

示例2: db_gettablelist

function db_gettablelist()
{
	global $conn;
	$ret=array();
	$rs = odbc_tables($conn);
	while(odbc_fetch_row($rs))
		if(odbc_result($rs,"TABLE_TYPE")=="TABLE" || odbc_result($rs,"TABLE_TYPE")=="VIEW")
			$ret[]=odbc_result($rs,"TABLE_NAME");
	return $ret;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:10,代码来源:dbinfo.odbc.php

示例3: db_gettablelist

 /**
  * @return Array
  */
 public function db_gettablelist()
 {
     $ret = array();
     $rs = odbc_tables($this->connectionObj->conn);
     while (odbc_fetch_row($rs)) {
         if (odbc_result($rs, "TABLE_TYPE") == "TABLE" || odbc_result($rs, "TABLE_TYPE") == "VIEW") {
             $ret[] = odbc_result($rs, "TABLE_NAME");
         }
     }
     return $ret;
 }
开发者ID:ryanblanchard,项目名称:Dashboard,代码行数:14,代码来源:ODBCInfo.php

示例4: initTables

 /**
  * @see DatabaseInfo::initTables()
  */
 protected function initTables()
 {
     include_once 'creole/drivers/odbc/metadata/ODBCTableInfo.php';
     $result = @odbc_tables($this->conn->getResource());
     if (!$result) {
         throw new SQLException('Could not list tables', $this->conn->nativeError());
     }
     while (odbc_fetch_row($result)) {
         $tablename = strtoupper(odbc_result($result, 'TABLE_NAME'));
         $this->tables[$tablename] = new ODBCTableInfo($this, $tablename);
     }
     @odbc_free_result($result);
 }
开发者ID:taryono,项目名称:school,代码行数:16,代码来源:ODBCDatabaseInfo.php

示例5: odbc_tables

 function &MetaTables()
 {
     $qid = odbc_tables($this->_connectionID);
     $rs = new ADORecordSet_odbc($qid);
     //print_r($rs);
     $arr =& $rs->GetArray();
     $arr2 = array();
     for ($i = 0; $i < sizeof($arr); $i++) {
         if ($arr[$i][2] && substr($arr[$i][2], 0, 4) != 'MSys') {
             $arr2[] = $arr[$i][2];
         }
     }
     return $arr2;
 }
开发者ID:qoire,项目名称:portal,代码行数:14,代码来源:adodb-access.inc.php

示例6: afficheTables

 function afficheTables($pFichAction)
 {
     //remplissage de la liste
     $tablelist = odbc_tables($this->connexion);
     echo '<form name="choixTables" method="get" action="' . $pFichAction . '">';
     echo '<select name="lesTables">';
     while (odbc_fetch_row($tablelist)) {
         if (odbc_result($tablelist, 4) == "TABLE") {
             // Si l'objet en cours a pour indicateur TABLE                //test à ajouter dans la condition pour ne pas afficher les  tables système en Access     && !(substr(odbc_result($tablelist,3),0,4)=="MSys")
             echo '<option value="' . odbc_result($tablelist, 3) . '">' . odbc_result($tablelist, 3) . '</option>';
         }
         // Affiche nom de la TABLE
     }
     echo '</select><input type="submit" value="Afficher"></input></form>';
 }
开发者ID:silly-kid,项目名称:MonPortefolio,代码行数:15,代码来源:classGesTables.php

示例7: getTables

 /**
  * Retorna un array con las tablas accesibles por el ODBC. Cada array tiene los encabezados
  * KEY => VALUE y los key son las constantes TABLE_*
  */
 public function getTables()
 {
     $tables = array();
     if ($this->_isConnected()) {
         $result = odbc_tables($this->conn);
         if (!$result) {
             $this->_error = "No fue posible consultar las respuestas";
             return null;
         }
         while ($row = odbc_fetch_array($result)) {
             $tables[] = $row;
         }
     } else {
         $this->_error = "No se encuentra conectado a ningun ODBC";
         return null;
     }
     return $tables;
 }
开发者ID:dnetix,项目名称:utils,代码行数:22,代码来源:ODBCHandler.php

示例8: odbc_tables

 function &MetaTables()
 {
     global $ADODB_FETCH_MODE;
     $savem = $ADODB_FETCH_MODE;
     $ADODB_FETCH_MODE = ADODB_FETCH_NUM;
     $qid = odbc_tables($this->_connectionID);
     $rs = new ADORecordSet_odbc($qid);
     $ADODB_FETCH_MODE = $savem;
     if (!$rs) {
         return false;
     }
     $rs->_has_stupid_odbc_fetch_api_change = $this->_has_stupid_odbc_fetch_api_change;
     $arr =& $rs->GetArray();
     $arr2 = array();
     for ($i = 0; $i < sizeof($arr); $i++) {
         if ($arr[$i][2] && substr($arr[$i][2], 0, 4) != 'MSys') {
             $arr2[] = $arr[$i][2];
         }
     }
     return $arr2;
 }
开发者ID:OberjukhtinIA0VWV0Allokuum,项目名称:testmasteke.leo,代码行数:21,代码来源:adodb-access.inc.php

示例9: odbc_errormsg

            print "<p>Uh-oh! Failure to connect to DSN [{$DSN}]: <br />";
            odbc_errormsg();
        } else {
            print "done</p>\n";
            $resultset = odbc_exec($handle, "{$query}");
            odbc_result_all($resultset, "border=2");
            odbc_close($handle);
        }
    } else {
        print "<p>Sorry, that query has been disabled for security reasons</p>\n";
    }
}
if ($listtables != NULL) {
    print "<h2>List of tables</h2>";
    print "<p>Connecting... ";
    $handle = odbc_connect("{$DSN}", "{$uid}", "{$passwd}");
    print "done</p>\n";
    if (!$handle) {
        print "<p>Uh-oh! Failure to connect to DSN [{$DSN}]: <br />";
        odbc_errormsg();
    } else {
        $resultset = odbc_tables($handle);
        odbc_result_all($resultset, "border=2");
        odbc_close($handle);
    }
}
?>

</body>
</html>
开发者ID:neuroidss,项目名称:virtuoso-opensource,代码行数:30,代码来源:odbc-sample.php

示例10: odbc_tables

<?php

$result = odbc_tables($connection);
$first = isset($_POST['first']) ? $_POST['first'] : 0;
if (isset($_POST['rows'])) {
    $max = $_POST['rows'];
}
if ($result) {
    echo "\"data\":[";
    $j = 0;
    // For some reason odbc_fetch_array ignores the second parameter
    while ($first >= 0) {
        $data = odbc_fetch_array($result);
        $first--;
    }
    while ($data) {
        echo json_encode($data);
        $j++;
        if (!(isset($max) && $j >= $max)) {
            $data = odbc_fetch_array($result);
        } else {
            $data = false;
        }
        if ($data) {
            echo ",";
        }
    }
    echo "],";
}
echo "\"totalRecords\":" . $j . ",";
$status = "ok";
开发者ID:jeronimonunes,项目名称:OdbcWebAdmin,代码行数:31,代码来源:tables.php

示例11: listSources

 /**
  * Returns an array of sources (tables) in the database.
  *
  * @return array Array of tablenames in the database
  */
 function listSources()
 {
     $cache = parent::listSources();
     if ($cache != null) {
         return $cache;
     }
     /*$result = odbc_tables($this->connection);
     		if (function_exists('odbc_fetch_row')) {
     			echo 'GOOD';
     		} else {
     			echo 'BAD';
     		}*/
     $result = odbc_tables($this->connection);
     $tables = array();
     while (odbc_fetch_row($result)) {
         array_push($tables, odbc_result($result, "TABLE_NAME"));
     }
     parent::listSources($tables);
     return $tables;
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:25,代码来源:dbo_odbc.php

示例12: getTableList

 /**
  * Description
  *
  * @access	public
  * @return array A list of all the tables in the database
  */
 function getTableList()
 {
     return odbc_tables($this->_resource);
 }
开发者ID:Jonathonbyrd,项目名称:SportsCapping-Experts,代码行数:10,代码来源:odbc.php

示例13: cmp

}
function cmp($arr1, $arr2)
{
    $a = $arr1[1];
    /* count of cols in 1st array */
    $b = $arr2[1];
    /* count of cols in 2nd array */
    if ($a == $b) {
        return 0;
    }
    return $a < $b ? -1 : 1;
}
prepare_conversion();
$table_names = array();
$tables = array();
$r = odbc_tables($conn);
while ($t = odbc_fetch_array($r)) {
    //    print_r($t);
    $type = $t['TABLE_TYPE'] == 'TABLE';
    $owner = true;
    if (isset($t['TABLE_OWNER'])) {
        $owner = strtolower($t['TABLE_OWNER']) != 'information_schema';
    }
    if ($type && $owner) {
        $table_names[] = $t['TABLE_NAME'];
    }
}
for ($i = 0; $i < count($table_names); $i++) {
    $cols = get_cols($conn, $table_names[$i]);
    $cnt = count($cols);
    $tables[] = array($cols, $cnt, $table_names[$i]);
开发者ID:keyur-rathod,项目名称:web2py-appliances,代码行数:31,代码来源:import.php

示例14: odbc_connect

 */
$odbc['dsn'] = "SageLine50v19";
// pointing to C:\Documents and Settings\All Users\Application Data\Sage\Accounts\2013\Demodata\ACCDATA
//$odbc['dsn'] = "sagedemo";
$odbc['user'] = "manager";
$odbc['pass'] = "";
// Step 1: Connect to the source ODBC database
if ($debug) {
    echo "Connect to " . $odbc['dsn'] . ' as ' . $odbc['user'] . "\n";
}
$conn = odbc_connect($odbc['dsn'], $odbc['user'], $odbc['pass']);
if (!$conn) {
    die("Error connecting to the ODBC database: " . odbc_errormsg());
}
// loop through each table
$allTables = odbc_tables($conn);
$tablesArray = array();
while (odbc_fetch_row($allTables)) {
    if (odbc_result($allTables, "TABLE_TYPE") == "TABLE") {
        $tablesArray[] = odbc_result($allTables, "TABLE_NAME");
    }
}
//print_r($tablesArray);      // to list all tables
if (!empty($tablesArray)) {
    // loop though each table
    foreach ($tablesArray as $currentTable) {
        echo "Table " . $currentTable;
        // get first, or all entries in the table.
        if ($debug) {
            echo $currentTable;
        }
开发者ID:Developers-account,项目名称:sage,代码行数:31,代码来源:sage1.php

示例15: odbc_connect

<html>
<head>
<title>ezRETS Metadata Viewer with PHP</title>
</head>
<body>
About to make a connection.<br/>
<?php 
$dsn = "retstest";
$user = "Joe";
$pwd = "Schmoe";
$conn = odbc_connect($dsn, $user, $pwd);
?>
Connection made.<br/>
<?php 
// lookup tables
$tableexec = odbc_tables($conn);
$table_count = odbc_num_fields($tableexec);
echo "There are {$table_count} tables on the server</br>";
?>
<table border="0" width="100%" cellpadding="10" cellspacing="0">
<?php 
// loop through tables
while (odbc_fetch_row($tableexec)) {
    ?>
  <tr>
    <td>
      <table border=\"1\">
        <tr bgcolor="yellow">
          <th>Table Name</th><th>Description</th><th>Columns</th>
        </tr>
        <tr>
开发者ID:adderall,项目名称:ezRETS,代码行数:31,代码来源:MetadataViewer.php


注:本文中的odbc_tables函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。