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

 

Quits editing mode.

 

       bool i5_cancel_edit (resource file)

 

 

Parameters

 result

Open file ID

 

Return

TRUE if editing mode is deactivated FALSE if not. 

 

I5_ERR_PHP_HDLBAD

258

Bad connection handle

I5_ERR_PHP_RESOURCE_BAD

261

No resource found.

I5_ERR_PHP_TYPEPARAM

262

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

Type z was provided.

I5_ERR_PHP_NBPARAM_BAD

263

Wrong parameter count

 

Detail

After calling i5_edit (switching to editing mode to record a file), i5_cancel_edit function restores normal mode.

Depending on editing mode, if updating is not automatic (I5_EDIT_AUTO), any modifications introduced with i5_setvalue will be lost.

 

 

Example

 

 

/* Activate current record edition mode */

$res = i5_open("EASYCOM/TEST");

$ret = i5_edit($res, I5_EDIT_ONE);

if(!$ret) {

    echo "error code: " . i5_errno($conn) . "<br>";

    echo "error message: " . i5_errormsg($conn) . "<br>";

    }

else {

 

 

/* Modifies ONE current record field value */

$ret = i5_setvalue($ret, "CODE", "C-02");

 

if ($_GET["confirmation"]=="no") {

    $cancel = i5_cancel_edit($res);

}

 

 

See also

i5_open

i5_edit

i5_update

i5_delete

i5_addnew