本文整理汇总了PHP中msql_list_tables函数的典型用法代码示例。如果您正苦于以下问题:PHP msql_list_tables函数的具体用法?PHP msql_list_tables怎么用?PHP msql_list_tables使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了msql_list_tables函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSpecialQuery
/**
* Obtain a list of a given type of objects
*
* @param string $type the kind of objects you want to retrieve
*
* @return array the array containing the list of objects requested
*
* @access protected
* @see DB_common::getListOf()
*/
function getSpecialQuery($type)
{
switch ($type) {
case 'databases':
$id = @msql_list_dbs($this->connection);
break;
case 'tables':
$id = @msql_list_tables($this->dsn['database'], $this->connection);
break;
default:
return null;
}
if (!$id) {
return $this->msqlRaiseError();
}
$out = array();
while ($row = @msql_fetch_row($id)) {
$out[] = $row[0];
}
return $out;
}
示例2: list_tables
/**
* db::list_tables()
*
* @param $dbname
* @return
**/
function list_tables($dbname)
{
global $GonxAdmin;
switch ($GonxAdmin["dbtype"]) {
case "mysql":
$this->dbResultLine = @mysql_list_tables($dbname);
break;
case "postgresql":
$sql = "SELECT relname FROM pg_class WHERE relname !~ '^pg_'";
$this->dbResultLine = $this->query($sql);
break;
case "oracle":
$sql = "select * from user_objects where object_type = 'TABLE';";
$this->dbResultLine = $this->query($sql);
break;
case "sqlite":
break;
case "mssql":
$this->dbResultLine = @msql_list_tables($dbname);
break;
}
// switch
return $this->dbResultLine;
}