i5_next_result

 

Moves pointer to next result.

 

bool i5_next_result (

resource Stmt )

 

Details

 

i5_next_result function is used with prepared requests (or stored procedures) likely to return several results.

It returns TRUE if another result is available and moves the pointer.

The next call to i5_fetch_xxx type function will read again a results set, it is impossible to return to the first results set.

If option I5_OPTIONS_AUTOMATIC_NEXT_RESULT wasn’t set to "1" during connection, you need to call i5_next_result() after i5_execute() call, to get the first result set.

 

Parameters

 

stmt

i5_prepare returned request ID

 

Returns:

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_TYPEPARAM

262

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

 

 

Example

 

Example

 

 

$stmt = i5_prepare('call EASYCOM/S_ORD_SUM');

if (is_bool($stmt))

  trigger_error("i5_prepare error : ".i5_errormsg(), E_USER_ERROR);

 

$ret = i5_execute($stmt);

if (!$ret)

 trigger_error("i5_execute error : ".i5_errormsg(), E_USER_ERROR);

  

$stmt2 = i5_next_result($stmt);

if (is_bool($stmt2))

 trigger_error("i5_next_result error : ".i5_errormsg(), E_USER_ERROR);

$rec = i5_fetch_row($stmt2, I5_READ_NEXT);

if (is_bool($rec))

trigger_error("i5_fetch_row error : ". i5_errormsg(), E_USER_ERROR);

echo "First CLIENT : ";print_r($rec);echo "<BR>";

 

$ret = i5_free_file($stmt2);

if (!$ret)

 trigger_error("i5_free_file error : ".i5_errormsg(), E_USER_ERROR);

$ret = i5_free_file($stmt);

if (!$ret)

 trigger_error("i5_free_file error : ".i5_errormsg(), E_USER_ERROR);

 

 

See also

 

i5_prepare

i5_execute