Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_free_result(3) [php man page]

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)

Check Out this Related Man Page

PG_RESULT_SEEK(3)														 PG_RESULT_SEEK(3)

pg_result_seek - Set internal row offset in result resource

SYNOPSIS
bool pg_result_seek (resource $result, int $offset) DESCRIPTION
pg_result_seek(3) sets the internal row offset in a result resource. PARAMETERS
o $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others). o $offset - Row to move the internal offset to in the $result resource. Rows are numbered starting from zero. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_result_seek(3) example <?php // Connect to the database $conn = pg_pconnect("dbname=publisher"); // Execute a query $result = pg_query($conn, "SELECT author, email FROM authors"); // Seek to the 3rd row (assuming there are 3 rows) pg_result_seek($result, 2); // Fetch the 3rd row $row = pg_fetch_row($result); ?> SEE ALSO
pg_fetch_row(3), pg_fetch_assoc(3), pg_fetch_array(3), pg_fetch_object(3), pg_fetch_result(3). PHP Documentation Group PG_RESULT_SEEK(3)
Man Page

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Output result to a non-delimitted file

Hello I need to run an sql script and then the output result to be in non-delimitted file What is the execution command to obtain this. For eg: the following outputs the result to a space delimitted file db2batch -d ${EC_DB2_DBNAME} -f ${TMP_SCRIPT_NAME} -a ${CURR_DB_ID}/${CURR_DB_PWD} -r... (1 Reply)
Discussion started by: cosec
1 Replies

2. Shell Programming and Scripting

Problem in Passing sql query for a script

Unix prompt ========= echo "Enter the query" read q ========== User has entered : SELECT * FROM employee ===================== Now the problem starts.. echo $q Output: SELECT "all files names in the PWD" FROM employee ================================================ ... (5 Replies)
Discussion started by: Niroj
5 Replies

3. Programming

Current and Peak Memory consumption of my program?

Hi, my C++ program does some memory consuming tasks and runs several minutes. During execution time, I want to print information on the current memory consumption and peak memory consumption of my program into a logfile. How can I retrieve this information, i.e. which functions are available... (0 Replies)
Discussion started by: DarthVader77
0 Replies

4. Red Hat

To get the memory in MB

Hi I am trying to get the memory in the box using the belkow command. this is giving me the proper result in KB's. I would like to convert it into MB's. cat /proc/meminfo | grep MemTotal | cut -d " " -f6 32962184 But when I execute the below command, its throwing the error. expr ` \(... (3 Replies)
Discussion started by: chromegg
3 Replies

5. SCO

Partition Resize / Creation

Hello, I'm new to SCO and I require some help... I have an OLD HD which is about to die and I want to replace it with a new HD. When I clone the HD with either Acronis or Ghost it wont allow me to resize the UNIX partition and I'm stuck with 80% of the new drive as unused space. I... (7 Replies)
Discussion started by: dochost
7 Replies

6. AIX

Memory consumption issue in AIX box

Hi, monitor memory usage on AIX machine on any day of the week from 3:00 PM ET to 5:00 PM ET - Povide min and max memory consumption. Determine if all of the available memory is visible to the operating system. If it is not, determine the amount of memory which may be allocated to the... (3 Replies)
Discussion started by: Rookie_newbie
3 Replies

7. Shell Programming and Scripting

php script problem

$result = shell_exec("/sbin/checkscript.sh jdoe"); echo "$result" ; i am running a script through php. the script is /sbin/checkscript jdoe. this script is supposed to output something similar to this: ################################ #### Welcome John Doe... (0 Replies)
Discussion started by: SkySmart
0 Replies

8. UNIX for Dummies Questions & Answers

A lil help for my problem guys SELECT

i need to create a script using the patterns below. im not good in script writing so i need your help guys.. i thing i can use SELECT here but dont really know how to start. 1. Create a script named exercise1.sh that will generate a menu with the following items: a. Current Logins b. Last... (2 Replies)
Discussion started by: JONATHAN0919
2 Replies