Re: php + postgresql
От | Aarni Ruuhimäki |
---|---|
Тема | Re: php + postgresql |
Дата | |
Msg-id | 200807241514.13444.aarni@kymi.com обсуждение исходный текст |
Ответ на | php + postgresql (admin <mick@mjhall.org>) |
Ответы |
Re: php + postgresql
|
Список | pgsql-general |
On Thursday 24 July 2008 12:41, admin wrote: > 1. > I ended up using pg_prepare() and pg_execute() as pg_query() alone just > didn't seem to work. But SELECT statements seemed to be cached or > persistent in some way, such that they "lived" beyond the life of the > PHP script. Is there something I need to know about persistent behaviour > in PG that doesn't exist in MySQL? Not sure what causes this with your server but I always use something like this, ie first connect then do your stuff and then close the connection: require("dbconnect.inc"); // holds the $conn which is pg_connect("with passes") if (!$conn) {exit("Database connection failed. Please try again." . $conn);} $sql ="SELECT ..."; $product=pg_exec($conn,$sql); if (!$product) {exit("Database connection failed. Please try again.");} while ($row = pg_fetch_row($product)) { echo" $row[1] "; } pg_close($conn); BR, -- Aarni Burglars usually come in through your windows.
В списке pgsql-general по дате отправления: