- 追加された行はこの色です。
- 削除された行はこの色です。
#freeze
#setlinebreak(on)
* MDB2 真・データベース制御クラス [#z179f3f5]
[[mysqliをMDB2で利用する>PEAR/MDB2/mysqli]]
#htmlinsert(googleAdsense.html)
#ref(http://dozo.rgr.jp/img/img20_file.png,right,nolink,around,PHP::PEAR)
** 概要 [#o3e15e0c]
なるほど。
これはいいね。
(ノ・・)ン。。。。。。(((●コロコロッ
[[PEAR::DB>PEAR/DB]]にはこれ以上となくお世話になっている。
だが、データベースがどんどん進化・多様化してきている中、
[[PEAR::DB>PEAR/DB]]はその進化・多様化に追いついていない。
そして重いと評判だ。
(私的にはそうでもないのだが。)
その重さを軽減するために登場したのが[[PEAR::MDB>PEAR/MDB]]。
リファクタリングしてソースコードがすっきり。
非常に見やすい。
PostgreSQLで使う以外は[[PEAR::MDB>PEAR/MDB]]の方が速い(らしい)。
ただ問題なのは[[PEAR::MDB>PEAR/MDB]]はすでに開発が終了してしまったことだ。
そこで登場したのがPEAR::MDB2。
元々は[[PEAR::MDB>PEAR/MDB]]のPHP5版として登場したのだが、
PEAR::MDB2側に吸収された。
新たにDriver, Moduleという概念が追加され、
ファイルは細かく分割されている。
PEAR::DB_DataObjectのようにテーブル定義をファイルに保存しておき、
それをオブジェクトとして利用することが出来る
DriverとはPECL::PDOのように、
データベースの種類ごとにパッケージ化し、
それぞれを別パッケージとして開発している。
利用者はPEAR::MDB2とは別に使用するデータベースに応じたパッケージをインストールする。
例:
MySQLの時
pear install mdb2
pear install MDB2_Driver_mysql
PostgreSQLの時
pear install mdb2
pear install MDB2_Driver_pgsql
ModuleとはPEAR::MDB2の拡張機能のことだ。
利用者はモジュールをロードして機能を拡張することになる。
例:
Extended
$dbObj->loadModule('Extended');
** PEAR::DBとPEAR::MDB2の相違点 [#ke17563c]
既存のシステムで[[PEAR::DB>PEAR/DB]]を使用していて、
PEAR::MDB2に置き換えるときはいくつか注意が必要だ。
デフォルトでFactory Method(connectも)パターンの他に、
singletonパターンも装備している。
自前でsingletonパターンを作っていた人は、
こっちを利用する方が良いだろう。
[[autoCommit>PEAR/DB/autoCommit]]メソッドは削除されている。
トランザクションを利用するときは
begenTransactionメソッドを利用する。
その際、transactionオプションを有効にしておく必要がある。
$dbObj = & MDB2::singleton($dsn, array('use_transactions'=>true));
$dbObj->beginTransaction(); // transaction start
[[quoteSmart>PEAR/DB/quoteSmart]]メソッドは削除されている。
quoteを利用する場合は
quoteメソッドを利用する。
[[PEAR::DB>PEAR/DB]]のgetAll, getAssoc, getOne, getColなどはデフォルトで存在しない。
これらはExtendedモジュールに入っているので、
利用する際はExtendedモジュールをロードしておく必要がある。
私は使わないのだがgetAssocの挙動はPEAR::DBとはかなり異なるようだ。
-MDB2用のDBMSドライバの名前はMDB2_Driver_xxxxxx ですね。 -- [[nobby]] &new{2006-05-06 07:13:38 (土)};
-ほんとですね。修正しておきます。 -- [[dozo]] &new{2006-05-06 10:59:21 (土)};
-dddd -- &new{2006-05-18 18:01:54 (木)};
-dddd -- [[dozo]] &new{2006-05-20 00:16:50 (土)};
-Hello. <a href=http://pthc-hussyfan.50webs.com/preteen-nude.html>preteen nude</a> <a href=http://pthc-hussyfan.50webs.com/hussyfan.html>hussyfan</a> <a href=http://pthc-hussyfan.50webs.com/preteen-models.html>preteen models</a><a href=http://pthc-hussyfan.50webs.com/index.html>hentai teen titans</a> <a href=http://pthc-hussyfan.50webs.com/preteen-lolitas.html>Preteen Lolitas</a> <a href=http://pthc-hussyfan.50webs.com/preteen-lolita.html>Preteen Lolita</a> <a href=http://pthc-hussyfan.50webs.com/pthc.html>pthc</a> <a href=http://pthc-hussyfan.50webs.com/preteen-pics.html>preteen pics</a> <a href=http://pthc-hussyfan.50webs.com/bukkake.html>bukkake</a> [url=http://pthc-hussyfan.50webs.com/preteen-lolitas.html]Preteen Lolitas[/url] [url=http://pthc-hussyfan.50webs.com/index.html]hentai teen titans[/url] [url=http://pthc-hussyfan.50webs.com/preteen-models.html]preteen models[/url] [url=http://pthc-hussyfan.50webs.com/pthc.html]pthc[/url] [url=http://pthc-hussyfan.50webs.com/preteen-pics.html]preteen pics[/url] [url=http://pthc-hussyfan.50webs.com/preteen-nude.html]preteen nude[/url] http://pthc-hussyfan.50webs.com/preteen-lolitas.html -- [[Mamadshah]] &new{2007-06-03 02:35:05 (日)};
-Hello, nice site look this:<a href="http://vsdtrhs.myfreewebs.net/mortgage-loan.html">mortgage loan</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-calculations.html">mortgage calculations</a><a href="http://vsdtrhs.myfreewebs.net/home-loan-mortgage.html">home loan mortgage</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-note-buyers.html">mortgage note buyers</a><a href="http://vsdtrhs.myfreewebs.net/net-branch-for-mortgage-brokers.html">net branch for mortgage brokers</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-insurance.html">mortgage insurance</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-rates-florida.html">mortgage rates florida</a><a href="http://vsdtrhs.myfreewebs.net/ameriquest-mortgage.html">ameriquest mortgage</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-application.html">mortgage application</a><a href="http://vsdtrhs.myfreewebs.net/home-loan-mortgage.html">home loan mortgage</a><a href="http://vsdtrhs.myfreewebs.net/colorado-mortgage.html">colorado mortgage</a><a href="http://vsdtrhs.myfreewebs.net/commercial-mortgages.html">commercial mortgages</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-quotes.html">mortgage quotes</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-net-branch-companies.html">mortgage net branch companies</a><a href="http://vsdtrhs.myfreewebs.net/california-mortgages.html">california mortgages</a><a href="http://vsdtrhs.myfreewebs.net/reverse-mortgage.html">reverse mortgage</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-brokers.html">mortgage brokers</a><a href="http://vsdtrhs.myfreewebs.net/low-mortgage-rates.html">low mortgage rates</a><a href="http://vsdtrhs.myfreewebs.net/mortgage-loan-payment-calculator.html">mortgage loan payment calculator</a><a href="http://vsdtrhs.myfreewebs.net/compare-mortgage-interest-rates.html">compare mortgage interest rates</a>End ^) See you -- [[mortgage]] &new{2007-06-13 01:23:55 (水)};
-Hello, nice site look this:http://buymeridia.spb.pl/ * <a href='http://buymeridia.spb.pl/'>buy meridia</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>http://buyviagraonline.spb.pl/ * <a href='http://buyviagraonline.spb.pl/'>buy viagra online</a>http://orderviagra.spb.pl/ * <a href='http://orderviagra.spb.pl/'>order viagra</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://orderviagra.spb.pl/ * <a href='http://orderviagra.spb.pl/'>order viagra</a>http://ordercialis.spb.pl/ * <a href='http://ordercialis.spb.pl/'>order cialis</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>End ^) See you -- [[mortgage]] &new{2007-06-13 06:09:13 (水)};
-Hello, nice site look this:http://ordercialis.spb.pl/ * <a href='http://ordercialis.spb.pl/'>order cialis</a>http://buytramadolonline.spb.pl/ * <a href='http://buytramadolonline.spb.pl/'>buy tramadol online</a>http://buyphentermineonline.spb.pl/ * <a href='http://buyphentermineonline.spb.pl/'>buy phentermine online</a>http://ordercialis.spb.pl/ * <a href='http://ordercialis.spb.pl/'>order cialis</a>http://buytramadolonline.spb.pl/ * <a href='http://buytramadolonline.spb.pl/'>buy tramadol online</a>http://buymeridia.spb.pl/ * <a href='http://buymeridia.spb.pl/'>buy meridia</a>http://buyfioricet.spb.pl/ * <a href='http://buyfioricet.spb.pl/'>buy fioricet</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>http://buydiazepamonline.spb.pl/ * <a href='http://buydiazepamonline.spb.pl/'>buy diazepam online</a>http://orderviagra.spb.pl/ * <a href='http://orderviagra.spb.pl/'>order viagra</a>End ^) See you -- [[mortgage]] &new{2007-06-13 18:07:00 (水)};
-Hello, nice site look this:http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://buytramadolonline.spb.pl/ * <a href='http://buytramadolonline.spb.pl/'>buy tramadol online</a>http://ordercialis.spb.pl/ * <a href='http://ordercialis.spb.pl/'>order cialis</a>http://buyphentermineonline.spb.pl/ * <a href='http://buyphentermineonline.spb.pl/'>buy phentermine online</a>http://buyfioricet.spb.pl/ * <a href='http://buyfioricet.spb.pl/'>buy fioricet</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://orderviagra.spb.pl/ * <a href='http://orderviagra.spb.pl/'>order viagra</a>http://buyphentermineonline.spb.pl/ * <a href='http://buyphentermineonline.spb.pl/'>buy phentermine online</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>End ^) See you -- [[mortgage]] &new{2007-06-14 03:22:55 (木)};
-Hello, nice site look this:http://buyfioricet.spb.pl/ * <a href='http://buyfioricet.spb.pl/'>buy fioricet</a>http://orderviagra.spb.pl/ * <a href='http://orderviagra.spb.pl/'>order viagra</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://ordercialis.spb.pl/ * <a href='http://ordercialis.spb.pl/'>order cialis</a>http://buyviagraonline.spb.pl/ * <a href='http://buyviagraonline.spb.pl/'>buy viagra online</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://buycialisonline.spb.pl/ * <a href='http://buycialisonline.spb.pl/'>buy cialis online</a>http://buyvaliumonline.spb.pl/ * <a href='http://buyvaliumonline.spb.pl/'>buy valium online</a>End ^) See you -- [[mortgage]] &new{2007-06-14 07:48:27 (木)};
-Hello. See you -- [[Aerosmith]] &new{2007-06-15 23:22:52 (金)};
#comment