ここではPEAR::DBの使い方について確認していきます。PEAR::DBはPDOなどと同様にデータベースに依存しない形でプログラムの記述が出来ますのでデータベースの変更があった場合でも最小限の変更で済ますことができます。 DBパッケージがインストールが行われていない場合は下記のいずれかの方法にてインストールを先に行っておいて下さい。 pear install DB pear install -a DB pear install -o DB
PHPにはMySQLを利用するための関数が、あらかじめ用意されています。実はデータベースの基本的な操作は7つの関数だけで行なえます。 今回はその内の6つについて解説します。もちろん便利なMySQL関数はたくさんありますが、最初に覚えるのはこれだけで十分です。 しかも関数は使うパターンが決まっているので、一度基本的なプログラムを作ればあとは流用することができます。 またMySQLのデフォルトでは、パスワードが無い「root」ユーザーが設定されているので、これを接続に使うことにします。 mysqlデータベースのuserテーブル 【1】sample100 フォルダを作成します。 【2】新たに select.php を作成します。 *「\」はWindowsではエンマークのことです。 保存先 C:\phpdev\www\test\sample100 ファイル名 select.php <?php $u
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く