• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP odbc_tables函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: getTables

 /**
  * Returns list of tables.
  * @return array
  */
 public function getTables()
 {
     $result = odbc_tables($this->connection);
     $res = array();
     while ($row = odbc_fetch_array($result)) {
         if ($row['TABLE_TYPE'] === 'TABLE' || $row['TABLE_TYPE'] === 'VIEW') {
             $res[] = array('name' => $row['TABLE_NAME'], 'view' => $row['TABLE_TYPE'] === 'VIEW');
         }
     }
     odbc_free_result($result);
     return $res;
 }
开发者ID:jakubkulhan,项目名称:shopaholic,代码行数:16,代码来源:odbc.php


示例17: getSpecialQuery

 /**
  * Obtains the query string needed for listing a given type of objects
  *
  * Thanks to [email protected] and [email protected].
  *
  * @param string $type  the kind of objects you want to retrieve
  *
  * @return string  the list of objects requested
  *
  * @access protected
  * @see DB_common::getListOf()
  * @since Method available since Release 1.7.0
  */
 function getSpecialQuery($type)
 {
     switch ($type) {
         case 'databases':
             if (!function_exists('odbc_data_source')) {
                 return null;
             }
             $res = @odbc_data_source($this->connection, SQL_FETCH_FIRST);
             if (is_array($res)) {
                 $out = array($res['server']);
                 while ($res = @odbc_data_source($this->connection, SQL_FETCH_NEXT)) {
                     $out[] = $res['server'];
                 }
                 return $out;
             } else {
                 return $this->odbcRaiseError();
             }
             break;
         case 'tables':
         case 'schema.tables':
             $keep = 'TABLE';
             break;
         case 'views':
             $keep = 'VIEW';
             break;
         default:
             return null;
     }
     /*
      * Removing non-conforming items in the while loop rather than
      * in the odbc_tables() call because some backends choke on this:
      *     odbc_tables($this->connection, '', '', '', 'TABLE')
      */
     $res = @odbc_tables($this->connection);
     if (!$res) {
         return $this->odbcRaiseError();
     }
     $out = array();
     while ($row = odbc_fetch_array($res)) {
         if ($row['TABLE_TYPE'] != $keep) {
             continue;
         }
         if ($type == 'schema.tables') {
             $out[] = $row['TABLE_SCHEM'] . '.' . $row['TABLE_NAME'];
         } else {
             $out[] = $row['TABLE_NAME'];
         }
     }
     return $out;
 }
开发者ID:jkimdon,项目名称:cohomeals,代码行数:63,代码来源:odbc.php


示例18: getResultResource

getResultResource(){return$this->resultSet;}function
getTables(){$res=odbc_tables($this->connection);$tables=array();while($row=odbc_fetch_array($res)){if($row['TABLE_TYPE']==='TABLE'||$row['TABLE_TYPE']==='VIEW'){$tables[]=array('name'=>$row['TABLE_NAME'],'view'=>$row['TABLE_TYPE']==='VIEW');}}odbc_free_result($res);return$tables;}function
开发者ID:nosko,项目名称:socialSearch,代码行数:2,代码来源:dibi.min.php


示例19: DoExecute

 function DoExecute()
 {
     //parent::DoExecute();
     $this->Result = odbc_tables($this->Db->Connection);
 }
开发者ID:JeffersonFSilva,项目名称:turbophp,代码行数:5,代码来源:TpODBC.php


示例20: listTables

 /**
  * 
  */
 public function listTables()
 {
     $result = odbc_tables($this->_connection);
     //                or die("Error :".odbc_errormsg());
     $tables = array();
     try {
         while (odbc_fetch_row($result)) {
             if (odbc_result($result, "TABLE_TYPE") == "TABLE") {
                 $tables[] = odbc_result($result, "TABLE_NAME");
             }
         }
     } catch (Exception $e) {
         if ($this->debug) {
             echo $e->getCode() . ' ' . $e->getMessage();
         }
     }
     return $tables;
 }
开发者ID:Jonathonbyrd,项目名称:Optimized-Magento-1.9.x,代码行数:21,代码来源:Db.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP odbtp_affected_rows函数代码示例发布时间:2022-05-15
下一篇:
PHP odbc_prepare函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap