Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_affected_rows(3) [php man page]

PG_AFFECTED_ROWS(3)													       PG_AFFECTED_ROWS(3)

pg_affected_rows - Returns number of affected records (tuples)

SYNOPSIS
int pg_affected_rows (resource $result) DESCRIPTION
pg_affected_rows(3) returns the number of tuples (instances/records/rows) affected by INSERT, UPDATE, and DELETE queries. Since PostgreSQL 9.0 and above, the server returns the number of SELECTed rows. Older PostgreSQL return 0 for SELECT. Note This function used to be called pg_cmdtuples(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
The number of rows affected by the query. If no tuple is affected, it will return 0. EXAMPLES
Example #1 pg_affected_rows(3) example <?php $result = pg_query($conn, "INSERT INTO authors VALUES ('Orwell', 2002, 'Animal Farm')"); $cmdtuples = pg_affected_rows($result); echo $cmdtuples . " tuples are affected. "; ?> The above example will output: 1 tuples are affected. SEE ALSO
pg_query(3), pg_query_params(3), pg_execute(3), pg_num_rows(3). PHP Documentation Group PG_AFFECTED_ROWS(3)

Check Out this Related Man Page

PG_NUM_FIELDS(3)														  PG_NUM_FIELDS(3)

pg_num_fields - Returns the number of fields in a result

SYNOPSIS
int pg_num_fields (resource $result) DESCRIPTION
pg_num_fields(3) returns the number of fields (columns) in a PostgreSQL result resource. Note This function used to be called pg_numfields(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
The number of fields (columns) in the result. On error, -1 is returned. EXAMPLES
Example #1 pg_num_fields(3) example <?php $result = pg_query($conn, "SELECT 1, 2"); $num = pg_num_fields($result); echo $num . " field(s) returned. "; ?> The above example will output: 2 field(s) returned. SEE ALSO
pg_num_rows(3), pg_affected_rows(3). PHP Documentation Group PG_NUM_FIELDS(3)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

output arguments from a sqlplus

Hi. I need to output a 4 queries result into another application using result=`sqlplus -s ${3}/${4}@${2} << EOF ... query1 query2 query3 query4 .... echo "$metrics1" and returning those individual values into another app. (query1 and 3compute one value, query 2 and 4 compute 4... (3 Replies)
Discussion started by: shell_zen
3 Replies

2. Shell Programming and Scripting

Extract resultset numeric value from isql output ?

isql output comes as below, (0 rows affected) (1 row affected) (7 rows affected) How to extract the resultset number alone from the particular line ?? such as 0 1 7 (3 Replies)
Discussion started by: vikram3.r
3 Replies

3. Shell Programming and Scripting

File Formatting

Hi, Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it. Input ====================== l_s := ' INSERT INTO TEST' l_P PD := ' UPDATE INTO TEST' l_D := ' DELETE INTO TEST' This is test Input ======================... (1 Reply)
Discussion started by: saurabhbaisakhi
1 Replies

4. Shell Programming and Scripting

File Formatting

Hi, Need to delete all the records prior to pattern (INSERT/UPDATE/DELETE). If ' is available, then need to retain it. Input ====================== l_s := ' INSERT INTO TEST' l_P PD := ' UPDATE INTO TEST' l_D := ' DELETE INTO TEST' This is test Output ======================... (1 Reply)
Discussion started by: saurabhbaisakhi
1 Replies

5. Red Hat

Sun Storage Tek 6140 compatible with RHEL5.7?

Issue Description: ================ There are of 4 servers (SunFire X440) : siman7tdw: SunFire X440 (affected server) siman8tdw:SunFire X440 (affected server) siman9tdw:SunFire X440 siman10tdw:SunFire X440 Storage Server: Sun Storage Tek 6140 (Name: simantdw_disk_bak) and Sun Storage... (1 Reply)
Discussion started by: Pawan Kumar
1 Replies