PreviousNext
Help > API Functions > Native database access > i5_new_record
i5_new_record

 

 Inserts provided data into a new record.

 

          bool i5_new_record (resource file, array data)

 

Parameters

 

 

file

File handle returned by i5_open.

data

Data array for the new record.

The array can be a flat or associative array.

If a associative array is specify, the key is the name of field and the value pair contains the value of the field

 

 

 

Return

True if OK, false if failed.

 

I5_ERR_PHP_HDLDFT

256

No default connection found.

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x

and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_TYPEPARAM

262

Type of element x in parameter -1 must be y.

Type z was provided.

 

 

Example

 

 

$hdlFile = i5_open ("EASYCOM/SP_DET", I5_OPEN_READWRITE);

 if (IS_BOOL($hdlFile)) trigger_error("i5_open error : ".i5_errormsg(), E_USER_ERROR);

 

 $ret = i5_new_record ($hdlFile , array (2500, "1", 11564, "5", 5));

 if (!$ret) trigger_error("i5_new_record error : ".i5_errormsg(), E_USER_ERROR);

 

 echo "New record inserted <BR>";