Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_get_result(3) [php man page]

PG_GET_RESULT(3)														  PG_GET_RESULT(3)

pg_get_result - Get asynchronous query result

SYNOPSIS
resource pg_get_result ([resource $connection]) DESCRIPTION
pg_get_result(3) gets the result resource from an asynchronous query executed by pg_send_query(3), pg_send_query_params(3) or pg_send_exe- cute(3). pg_send_query(3) and the other asynchronous query functions can send multiple queries to a PostgreSQL server and pg_get_result(3) is used to get each query's results, one by one. PARAMETERS
o $connection - PostgreSQL database connection resource. RETURN VALUES
The result resource, or FALSE if no more results are available. EXAMPLES
Example #1 pg_get_result(3) example <?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); if (!pg_connection_busy($dbconn)) { pg_send_query($dbconn, "select * from authors; select count(*) from authors;"); } $res1 = pg_get_result($dbconn); echo "First call to pg_get_result(): $res1 "; $rows1 = pg_num_rows($res1); echo "$res1 has $rows1 records "; $res2 = pg_get_result($dbconn); echo "Second call to pg_get_result(): $res2 "; $rows2 = pg_num_rows($res2); echo "$res2 has $rows2 records "; ?> The above example will output: First call to pg_get_result(): Resource id #3 Resource id #3 has 3 records Second call to pg_get_result(): Resource id #4 Resource id #4 has 1 records SEE ALSO
pg_send_query(3). PHP Documentation Group PG_GET_RESULT(3)

Check Out this Related Man Page

PG_CANCEL_QUERY(3)														PG_CANCEL_QUERY(3)

pg_cancel_query - Cancel an asynchronous query

SYNOPSIS
bool pg_cancel_query (resource $connection) DESCRIPTION
pg_cancel_query(3) cancels an asynchronous query sent with pg_send_query(3), pg_send_query_params(3) or pg_send_execute(3). You cannot can- cel a query executed using pg_query(3). PARAMETERS
o $connection - PostgreSQL database connection resource. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 pg_cancel_query(3) example <?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); if (!pg_connection_busy($dbconn)) { pg_send_query($dbconn, "select * from authors; select count(*) from authors;"); } $res1 = pg_get_result($dbconn); echo "First call to pg_get_result(): $res1 "; $rows1 = pg_num_rows($res1); echo "$res1 has $rows1 records "; // Cancel the currently running query. Will be the second query if it is // still running. pg_cancel_query($dbconn); ?> The above example will output: First call to pg_get_result(): Resource id #3 Resource id #3 has 3 records SEE ALSO
pg_send_query(3), pg_connection_busy(3). PHP Documentation Group PG_CANCEL_QUERY(3)
Man Page

12 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cutting a limited or given set of records in a datbase

I need to select "cut" a certain number of records in a database. ie. records 20 to 25. Help (4 Replies)
Discussion started by: Iaf_user
4 Replies

2. Shell Programming and Scripting

Need help with Isql record count

What I am trying to do is check if the database query returned any records. If no records returned then output a message else output results to a file. Right now if I take out the if and else statements the code runs fine and sends the email. If no records returned the email sends the column... (4 Replies)
Discussion started by: johnu122
4 Replies

3. Programming

pro*c job retunn zero value

below is the sample pro*c code. i could print ParmKeyValue as ORG_PATH and CountryCode as HK, but the below query returns 0 records, but when i hard code the value, it records records SELECT nvl(rtrim(value), ' ') -- INTO :OrgFilepath ... (1 Reply)
Discussion started by: cgk_js
1 Replies

4. Shell Programming and Scripting

read records from a file

Hi all, I have a requirement where I need to read records one by one from a file. I have tried this below code: while read mLine do echo 'Line = '${mLine} done < input_file --- But the problem here is im getting the records with removed spaces. --Supposer if the record is like... (3 Replies)
Discussion started by: srilaxmi
3 Replies

5. Shell Programming and Scripting

mysql help : query with 2 conditionals

Hi there, I have a table that stores multiple records for many different servers, each of which is timestamped ... I wanted to write a query that would enable me to only output the "latest" record (based on timestamp) for each "unique" server. So for example my main table looks like this ... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

6. AIX

Resource Group Monitoring

Hi, I have a requirement to monitor the HACMP Resource Groups. At present in my environment, if the Resource Groups fail over from preferred node to Secondary node we dont get notification. Can some one help me in creating a scrript. I have more than one RG online. (Max 4 Resource Groups in... (2 Replies)
Discussion started by: srnagu
2 Replies

7. Shell Programming and Scripting

Block of records to select from a file

Hello: I am new to shell script programming. Now I would like to select specific records block from a file. For example, current file "xyz.txt" is containing 1million records and want to select the block of records from line number 50000 to 100000 and save into a file. Can anyone suggest me how... (3 Replies)
Discussion started by: nvkuriseti
3 Replies

8. UNIX for Advanced & Expert Users

query display number lines or records present in file only numeric value -without filename

Hi all Thanks in advance........... Please help me for this issue............ I have a file it has 11 records . I used the command like .... >$ wc -l file 11 file I'm getting output like 11 file (no.of records along with filename) here my requirement is, I want to display only... (3 Replies)
Discussion started by: ksrivani
3 Replies

9. UNIX for Dummies Questions & Answers

"echo *.out" - can I separate the results by a new line?

Greetings, Let's say I want to find files matching "*.out" in the current dir. I can do a echo *.out. However, the result is separated by a white space. Is there a way to have the results separated by a new line instead? I know this can be done by using find -maxdepth 1 -name '*.out'. The... (5 Replies)
Discussion started by: rasp
5 Replies

10. UNIX for Dummies Questions & Answers

multiple queries in single sqlplus

I need to connect a databas eusing sqlplus and i need to store the results of each query in separate file. is it possible to achieve this usng single sqlplus? i dont want to connect each time for each query. thanks (3 Replies)
Discussion started by: pandeesh
3 Replies

11. UNIX for Advanced & Expert Users

Group the records based on empno and send mail

Hi All, I have records in a file with name,SSO,openitems,manageremail with | delimited file.Now i want to group the records by SSO and openitems and send email to their manageremail. kiran|1111|draft|aaa@gmail.com guna|2222|reject|bbb@gmail.com kiran|1111|submitter|aaa@gmail.com... (2 Replies)
Discussion started by: kiranparsha
2 Replies

12. Red Hat

Linux PaceMaker Equivalent to a SharedAddress Resource Type

In HA platforms, there is the concept of a "Scalable Resource Type, which included the sharedaddress" that is used in commonly Web Servers resource groups. The sharedaddress resource type is provided so a developer can use this Resource type to build their own scalable resource group. I see... (1 Reply)
Discussion started by: mrmurdock
1 Replies