當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。