Firebird 2.0
PHP5 Programming
Manual

DATA TYPE CONVERSION

Basic conversions

Data is converted from Firebird SQL types to PHP types as follows:

Firebird type
PHP5 type

smallint, integer

integer

bigint

On 64-bit platforms, integer. On 32-bit platforms, integer if the value fits in 32 bits, string otherwise

float, double precision, numeric, decimal

float

char, nchar, varchar, national varchar

string

blob id

string

array_id

string

date, time, timestamp

string


Array identifiers can only be used as arguments to INSERT operations, as no functions to handle array identifiers are currently available.

The “flags” argument

The three fetch functions (fetch_assoc, fetch_object and fetch_row) have an additional “flags” argument. This argument modified the behaviour of how data is retrieved. The flags argument is a combination of the following constants OR'ed together:

Flag
Effect

IBASE_TEXT

Same as IBASE_FETCH_BLOBS

IBASE_FETCH_BLOBS

Causes blob contents to be fetched inline, instead of being fetched as blob identifiers.

IBASE_FETCH_ARRAYS

Causes arrays to be fetched inline. Otherwise, array identifiers are returned.

IBASE_UNIXTIME

Causes date and time fields not to be returned as strings, but as UNIX timestamps


Fetching times and dates as Unix timestamps might be problematic if used with dates before 1970 on some systems.


previous page goto index next page

Legal information