Passing queries on same persistent connection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Passing queries on same persistent connection

Post by gite_ashish »

Hello:


My sudo code goes something like this:

Code: Select all

<?php

// ...
// validate $schema1, $schema2 
// ...

$conn = pg_pconnect("... connection details ...");

$rs1 = pg_query($conn, "SET search_path TO $schema1, $schema2");
$rs2 = pg_query($conn, "SELECT * FROM table1");

// ...

?>

Since "search_path" is connection dependent setting it's important to have both queries executed in the same database connection.

I am using Persistent Connection, with this how to *confirm* that both of my above mentioned queries are being executed on the same connection ?

Thanks.
Post Reply