PHP 查詢特定PgSQL DB 內的所有TABLE的名稱並記錄到文字檔中
PHP 查詢特定PgSQL
DB
內的所有TABLE的名稱並記錄到文字檔中
<?php header(“Content-Type:text/html; $user=$_GET[‘user’]; $pw=$_GET[‘pw’]; $dbname=$_GET[‘dbname’]; set_time_limit(3600);//1hr if(!isset($user) { die(‘參數不足,無法執行‘); } $conn_string //$conn_string $dbconn pg_set_client_encoding($dbconn, //http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/ $sql $result $filename $filename1=”List.txt”; $myfile $myfile1 while { /* wget.exe */ $data=””; $data=”wget.exe fwrite($myfile, fwrite($myfile1, echo } pg_free_result($result); pg_close($con); fclose($myfile); fclose($myfile1); echo ?> |