PG_FREE_RESULT(3) PG_FREE_RESULT(3)
pg_free_result - Free result memory
SYNOPSIS
bool pg_free_result (resource $result)
DESCRIPTION
pg_free_result(3) frees the memory and data associated with the specified PostgreSQL query result resource.
This function need only be called if memory consumption during script execution is a problem. Otherwise, all result memory will be auto-
matically freed when the script ends.
Note
This function used to be called pg_freeresult(3).
PARAMETERS
o $result
- PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_free_result(3) example
<?php
$db = pg_connect("dbname=users user=me") || die();
$res = pg_query($db, "SELECT 1 UNION ALL SELECT 2");
$val = pg_fetch_result($res, 1, 0);
echo "First field in the second row is: ", $val, "
";
pg_free_result($res);
?>
The above example will output:
First field in the second row is: 2
SEE ALSO
pg_query(3), pg_query_params(3), pg_execute(3).
PHP Documentation Group PG_FREE_RESULT(3)