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

search for in the

dbase_pack> <dbase_numrecords
[edit] Last updated: Fri, 10 Feb 2012

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 を指定することはできません。

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

<?php

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

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

?>

返り値

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

参考



add a note add a note User Contributed Notes dbase_open
Anonymous 12-Jan-2008 12:05
COPY TO tablename.dbf TYPE FOXPLUS
The table is exported like DBase IV version and works fine with php.
jmertic at ncscredit dot com 17-Oct-2001 01: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.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites