[PHP-users 13633] Re: PEAR$B$G%U%#!<%k%I>pJs$r(B$B<hF@$9$k$H%l%3!<%I?t$,(B$B<hF@$G$-$J$$(B

Hidenori GOTO php-users@php.gr.jp
Fri, 28 Feb 2003 22:32:50 +0900


$B8eF#$G$9!#(B


$B!!$3$N7o!"$3$A$i$G$b2a5n$K(B Pear DB $B$rMxMQ$7$?(B DB $B%"%/%;%9%i(B
$B%$%V%i%j$r3+H/$7$?:]$KAx6x$7$^$7$?!#(B

$B!!860x$O!"(BPear DB $B$N(B pgsql.php $BFb(B tableinfo $B%a%=%C%I$N%P%0(B
$B$G$9!#(BCVS $B$+$i(B pgsql.php $B$r<hF@$7$F:9$7BX$($l$PBg>fIW$G$9!#(B


http://cvs.php.net/cvs.php/pear/DB/DB?login=2


ul$B!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=(B
ul$B!!M-8B2q<R!!%R%G%C%/%9!!8eF#!!=(@k!J$4$H$&(B $B$R$G$N$j!K(B
ul$B!!(BMailTo : goto@hidex.jp
ul$B!!(BWeb    : http://www.hidex.jp
ul$B!!(BTel    : 052-836-6339
ul$B!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=(B



> $B$*@$OC$K$J$C$F$*$j$^$9!#(Bmizusako$B$G$9!#(B
> 
> $B:n6H4D6-(B
> Turbolinux Server 6.5
> PHP 4.2.1
> PostgreSQL 7.2.1
> 
> $B!!(BPEAR$B$K$F(BDB$B$H$d$j$H$j$r$7$F$$$k$N$G$9$,!"%U%#!<%k%IL>$N<hF@$r9T$&$H!"(B
> $B%l%3!<%I?t$,<hF@$G$-$J$$8=>]$,=P$F$7$^$$$^$9!#(B
> $B2?$+$NA`:n$,B-$j$J$$$h$&$J5$$,$9$k$N$G$9$,!"$=$l$,2?$+$,$h$/J,$+$i$J$$>u(B
> $BBV$G$9!#(B
> $B2?$,860x$+!"$*$o$+$j$K$J$kJ}$,$$$i$C$7$c$$$^$7$?$i!"$465<x4j$($J$$$G$7$g(B
> $B$&$+!)(B
> 
> $B!];29M!](B
> common.php$B!J@\B3MQ(BPHP)
> 
> $db = DB::connect($dsn);
> $B!!!!(Bif(DB::isError($db)){
> $B!!!!(Becho '$B@\B3$K<:GT$7$^$7$?!#(B<br>';
> $B!!!!(Bexit ( $db->getMessage() );
> }
> 
> 
> test.php$B!J%G!<%?I=<(MQ!K(B
> 
> include_once 'common.php';
> 
> $sql = "select * from test";
> $result = $db->query($sql);  // SQL$B<B9T(B
> 
> $field_cnt  = $result->numcols();    // $B%U%#!<%k%I?t$N<hF@(B
> 
> $field_name = $result->tableinfo();  // $B%U%#!<%k%IL>$N<hF@(B
> for($i=0; $i<$field_cnt; $i++){
> $B!!!!(Bprint '$B%U%#!<%k%IL>(B:[" . $field_name[$i]["name"] . "]<br>";
> }
> 
> $result_cnt = $result->numrows(); // SQL$B$N7k2L7o?t$N<hF@(B
> 
> $B0J2<N,(B
> 
> 
> $B>e5-$N(Btest.php$B$N%U%#!<%k%IL>$N<hF@$N%m%8%C%/$rF~$l$k$H!"(BSQL$B$N7k2L7o?t$N(B
> $B7k2L$,%*%V%8%'%/%HJQ?t$K$J$C$F$7$^$$$^$9!#(B
> $B5U$KF~$l$J$$$H!"IaDL$K%l%3!<%I?t$,JV$C$F$-$^$9!#(B
> 
> PEAR$B$N%^%K%e%"%k(B($B2<5-%5%$%H!K$r;29M$K$7$F$$$^$9!#(B
> http://pear.php.net/manual/ja/core.db.php
> 
> _/_/_/_/_/_/_/_/_/_/_/_/_/
> Mizusako
> mizusako@southwave.co.jp
> _/_/_/_/_/_/_/_/_/_/_/_/_/_
> 
> 
> _______________________________________________
> PHP-users mailing list
> PHP-users@php.gr.jp
> http://ns1.php.gr.jp/mailman/listinfo/php-users