文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>关于phpPgAdmin的问题

关于phpPgAdmin的问题

时间:2006-03-21  来源:leaslie

phpPgAdmin 是一个充分地功能基于互联网的管理实用程序为PostgreSQL 数据库服务器。 它处理所有基本的功能并且某个先进的功能譬如触发器, 视图和功能(被存储的procs)
下载:http://www.tingyue.com/Dir11F/Page_222EC.htm
     
http://www.54shagua.com/html/253/109989.html
有没有研究过phpPgAdmin 的朋友???我急需它的数据库安装文件:*.sql
回复人: anziqi(美洲狮) ( ) 信誉:96
2002-09-29 23:49:53Z
得分:30
?
http://linuxbyte.net/showsoftd.php?ID=660

Top

回复人: pantech_36(~ 25436 ~) ( ) 信誉:104
2002-09-30 09:42:22Z
得分:40
?
我用的是这个你改一下下面的这一行
//$database=pg_connect("host=192.168.0.101 port=5432 dbname=crsdb user=oasisdb password=millennium");

Database Browser

\n";
echo "Type SQL Query Here
\n";
echo "
\n";
echo "\n";
echo "\n";
echo "\n";
echo "";
echo "
\n";
if($action=="usersql") {
        $usersql=stripslashes($usersql);
    echo "QUERY: ".htmlspecialchars($usersql)."
\n";
    echo "Return to tables
\n";
    $result=pg_exec($database,$usersql);
    if($numofrows=pg_numrows($result)) {
        echo "\n";
        $fields=pg_numfields($result);
        $fields2=$fields;
        while($fields2) {
            echo "".pg_fieldname($result,$fields-$fields2);
            echo "";
            $fields2-- ; }
        echo "\n";
        $click=0;
        while($numofrows > $click) {
            $row=pg_fetch_array($result,$click++);
            echo "";
            $fields2=$fields;
            while($fields2) {
                echo "";
                echo htmlspecialchars($row[$fields-$fields2--]);
                                echo " ";
                echo "";  }
            echo "\n";      
            }
    echo "";
    }
        else $action="";
}
if ($action=="") {
   $sql="SELECT usename, relname, relkind, relhasrules FROM pg_class, pg_user WHERE usesysid = relowner and ( relkind = 'r' OR relkind = 'S' OR relkind = 'v') and relname !~ '^pg_' and relname !~ '^xinx' ORDER BY relname";
   $result=pg_exec($database,$sql);

Top

回复人: pantech_36(~ 25436 ~) ( ) 信誉:104
2002-09-30 09:43:11Z
得分:30
?
//接上
if(!pg_NumRows($result)) echo "No Tables Found!";
    else {
    echo "\n";
    echo "OwnerRelationType\n";
    $click=0;
        $numofrows=pg_numrows($result);
    while($click ".$row[usename]."";
        echo "".$row[relname]."";
        if($row[relkind]=="S") echo "sequence\n";
        if($row[relkind]=="r") echo "table\n";
        if($row[relkind]=="i") echo "index\n";
        if($row[relkind]=="v") echo "view\n";
        }
    echo "\n";
    }
}
if($action=="viewt") {
   $sql="SELECT a.attnum as attnum, a.attname as attname, t.typname as typname, a.attlen as attlen, a.atttypmod as atttypmod, a.attnotnull as attnotnull, a.atthasdef as atthasdef FROM pg_class c, pg_attribute a, pg_type t WHERE c.relname = '$table' and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid ORDER BY attnum";
$result=pg_exec($database,$sql);
$sql2="SELECT viewname, definition FROM pg_views WHERE viewname like '$table'";
$result2=pg_exec($database,$sql2);
if (pg_numrows($result2)) {
    $row=pg_fetch_array($result2,0,1);
    echo "View = " . $row[viewname] . "
\n";
    echo "Query = " . $row[definition] . "
\n"; }
   else echo "Table = " . $table . "
\n";
   echo "Return to Tables
\n";
$click=0;
$numofrows=pg_numrows($result);
echo "\n";
echo "NameLengthType\n";
while($click ".$row[attname]."";
    if ($row[attlen]==-1) $row[attlen]="var";
    echo "".$row[attlen]."".$row[typname]." ";
    if($row[attnotnull]=="t") echo "not null ";
    if($row[atthasdef]=="t") {  
        echo "default = ";
        $sql2="SELECT d.adsrc as adsrc FROM pg_attrdef d, pg_class c WHERE c.relname = '$table' and c.oid = d.adrelid and d.adnum = ".$row[attnum];
        $result2=pg_exec($database,$sql2);
        $row2=pg_fetch_array($result2,0,1);
        echo $row2[adsrc]; }
    echo "\n";
    }
echo "\n";
$sql2="SELECT c2.relname as relname FROM pg_class c, pg_class c2, pg_index i WHERE c.relname = '$table' and c.oid = i.indrelid and i.indexrelid = c2.oid ORDER BY c2.relname";
$result2=pg_exec($database,$sql2);
if($numofrows=pg_numrows($result2)) {
    $click=0;
    while($numofrows > $click) {
        $row2=pg_fetch_array($result2,$click++,1);
        echo "
Index: " . $row2[relname] . "
\n";
        }
    }
}
?>



Top

该问题已经结贴 ,得分记录: anziqi (30)、 pantech_36 (40)、 pantech_36 (30)、


相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载