Jump to content

[SOLVED] PHP and Postgres connection


lazaroskyr

Recommended Posts

I wish to everyone a happy new year.
Here is my "silly" question.

I have this code:

Code:
[code]
$conn = pg_connect(...) or die("Couldn't Connect: ".pg_last_error());

if(something) {
insert_something();
}
elseif(something else) {
update_something();
}

function insert_something() {
...some code...(works nice)
}

function update_something() {
...some code...(cannot connect to db- i must reconnect)
}

[/code]

I cannot understand what is the reason that in the second function I lose connection to postgres and must reconnect...Can anyone help me?
Link to comment
https://forums.phpfreaks.com/topic/32684-solved-php-and-postgres-connection/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.