Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: dbase_open - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

dbase_pack" width="11" height="7"/> <dbase_numrecords
Last updated: Mon, 05 Feb 2007

view this page in

dbase_open

(PHP 4, PHP 5)

dbase_open — データベースをオープンする

説明

int dbase_open ( string filename, int mode )

dbase_open() は、指定したアクセスモードで dBase データベースをオープンします。

注意: セーフモード が有効の場合、PHP は操作を行うファイル/ディレクトリが実行するスクリプトと 同じ UID (所有者)を有しているかどうかを確認します。

注意: この関数の動作は、open_basedir の設定に依存します。

パラメータ

filename

データベースの名前。dBase がデータを格納するファイルの 相対パスあるいは絶対パス。

mode

open() システムコールに対応する整数値(通常、0 は読み込みのみ可・ 1 は書き込みのみ可・2 は読み書き両方可を意味します)。

注意: dBase ファイルを write-only モードでオープンしようとすると、 ヘッダ情報を読み込むことができないために関数は失敗します。 つまり、mode に 1 を指定することはできません。

例 451. dBase データベースファイルのオープン

<?php

// read-only モードでオープンする
$db = dbase_open('/tmp/test.dbf', 0);

if (
$db) {
 
// データを読み込む ..
 
 
dbase_close($db);
}

?>

返り値

データベースのオープンに成功した場合にリンク ID 、エラーが発生した場合に FALSE を返します。

参考

dbase_create()
dbase_close()



add a note add a note User Contributed Notes
dbase_open
jmertic at ncscredit dot com
17-Oct-2001 08:57
If you are wanting to open Foxpro tables using this, make sure they are in the 2.x format or php will not respond. In VFP use the following:

COPY TO tablename.dbf TYPE FOX2X

This is an easy way to bring database info to the web if you have a small foxpro setup.

dbase_pack" width="11" height="7"/> <dbase_numrecords
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites