PHP Manual


Table of Contents
I. Function Reference
I. MDB data file access library

I. Function Reference

Table of Contents
I. MDB data file access library

I. MDB data file access library

Introduction

mdbtools provides read access to MDB data files as used by Microsoft Access and its underlying JetEngine. It is based on libmdb from the mdbtools package available at http://mdbtools.sourceforge.net/


Requirements

This extension requires the following library: mdb

This extension requires the following header: mdbtools.h


Installation

mdbtools installation prefix


Runtime Configuration

This extension has no configuration directives defined in php.ini.


Resource Types

MdbDatabase

A MDB database resource connected to a *.mdb file.


MdbTable

A table within a MDB database.


Predefined Constants

Table 1. mdbtools constants

namevaluedescrpition
MDB_VER_JET3 (integer) MDB_VER_JET3 
MDB_VER_JET4 (integer) MDB_VER_JET4 
MDB_BOOL (integer) MDB_BOOLType 'Boolean'
MDB_BYTE (integer) MDB_BYTEType 'Byte'
MDB_INT (integer) MDB_INTType 'Integer'
MDB_LONGINT (integer) MDB_LONGINTType 'Long Integer'
MDB_MONEY (integer) MDB_MONEYType 'Currency'
MDB_FLOAT (integer) MDB_FLOATType 'Single'
MDB_DOUBLE (integer) MDB_DOUBLEType 'Double'
MDB_SDATETIME (integer) MDB_SDATETIMEType 'DateTime (Short)'
MDB_TEXT (integer) MDB_TEXTType 'Text'
MDB_OLE (integer) MDB_OLEType 'OLE'
MDB_MEMO (integer) MDB_MEMOType 'Memo/Hyperlink'
MDB_REPID (integer) MDB_REPIDType 'Replication ID'
MDB_NUMERIC (integer) MDB_NUMERICType 'Numeric'
Table of Contents
mdb_close -- Close an open Access .mdb file
mdb_fetch_assoc -- Get a table row as an associative array
mdb_fetch_row -- Get a table row as an enumerated array
mdb_num_fields -- Get number of table columns
mdb_num_rows -- Get number of table rows
mdb_open -- Open an Access .mdb file for reading
mdb_table_close -- Close an opened table
mdb_table_fields -- Get field type information for all fields in a table
mdb_table_open -- Open a table in an .mdb file for reading
mdb_tables -- Get names of tables in an .mdb file
mdb_type_name -- Look up the name for a field type
mdb_version -- Get Jet Engine version number from .mdb file

mdb_close

(no version information, might be only in CVS)

mdb_close -- Close an open Access .mdb file

Description

void mdb_close ( resource db)

Close a MDB file previously opened with mdb_open().

mdb_fetch_assoc

(no version information, might be only in CVS)

mdb_fetch_assoc -- Get a table row as an associative array

Description

array mdb_fetch_assoc ( resource table)

mdb_fetch_row() reads a single row from table and returns the data as an array with column names as index and field contents as values.

See also mdb_fetch_row().

mdb_fetch_row

(no version information, might be only in CVS)

mdb_fetch_row -- Get a table row as an enumerated array

Description

array mdb_fetch_row ( resource table)

mdb_fetch_row() reads a single row from table and returns the data as an numericaly indexed array.

See also mdb_fetch_assoc().

mdb_num_fields

(no version information, might be only in CVS)

mdb_num_fields -- Get number of table columns

Description

int mdb_num_fields ( resource table)

mdb_num_fields() returns the number of columns in table.

See also mdb_num_rows() and mdb_table_fields().

mdb_num_rows

(no version information, might be only in CVS)

mdb_num_rows -- Get number of table rows

Description

int mdb_num_rows ( resource table)

mdb_num_rows() returns the number of rows in table.

See also mdb_num_fields() and mdb_table_fields().

mdb_open

(no version information, might be only in CVS)

mdb_open -- Open an Access .mdb file for reading

Description

resource MdbDatabase mdb_open ( string path)

Open the MDB file path for reading.

See also mdb_close().

mdb_table_close

(no version information, might be only in CVS)

mdb_table_close -- Close an opened table

Description

void mdb_table_close ( resource table)

Close access to table.

mdb_table_fields

(no version information, might be only in CVS)

mdb_table_fields -- Get field type information for all fields in a table

Description

array mdb_table_fields ( resource table)

mdb_num_fields() returns type information about all columns in table. It returns an array with one element per column that itself is an array of name/value pairs describing the column.

Currently name, type, size, prec, scale and isfixed are extracted.

type is returned as an integer. The following constants correspond to the returned type codes: MDB_BOOL, MDB_BYTE, MDB_INT, MDB_LONGINT, MDB_MONEY, MDB_FLOAT, MDB_DOUBLE, MDB_SDATETIME, MDB_TEXT, MDB_OLE, MDB_MEMO, MDB_REPID and MDB_NUMERIC.

See also mdb_type_name().

mdb_table_open

(no version information, might be only in CVS)

mdb_table_open -- Open a table in an .mdb file for reading

Description

resource MdbTable mdb_table_open ( resource db, string table)

Return the names of all tables within the database db as an array of strings. Internal system tables like MSysObjects are ignored unless the optional parameter systabs is set to TRUE.

mdb_tables

(no version information, might be only in CVS)

mdb_tables -- Get names of tables in an .mdb file

Description

array mdb_tables ( resource db [, bool systabs])

Return the names of all tables within the database db as an array of strings. Internal system tables like MSysObjects are ignored unless the optional parameter systabs is set to TRUE.

mdb_type_name

(no version information, might be only in CVS)

mdb_type_name -- Look up the name for a field type

Description

string mdb_type_name ( resource db, int typecode)

mdb_type_name() returns the textual type name for the typecode in database db.

mdb_version

(no version information, might be only in CVS)

mdb_version -- Get Jet Engine version number from .mdb file

Description

int mdb_version ( resource db)

Return the JetEngine version number of db. This is either MDB_VER_JET3 or MDB_VER_JET4.