SQL query to a file

From: Marcelo Pereira <gandalf(at)sum(dot)desktop(dot)com(dot)br>
To: pgsql-php(at)postgresql(dot)org, php-pt(at)yahoogrupos(dot)com(dot)br
Subject: SQL query to a file
Date: 2002-07-01 12:41:40
Message-ID: Pine.LNX.4.20.0207010937240.657-100000@ni.hmmg.sp.gov.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hi All,

I have a connection to a PostgreSQL database, and I would to write a query
result to a file.

Example:
# ----8<----------------------------------------------
$conection = pgconnect(...
$sql = "select * from mytable";
$result = pg_exec($conection, $sql);
# -----8<---------------------------------------------

So, the results are stored in $result, how can I write this to a file?

Thanks in advance,

Marcelo Pereira

-- Remember that only God and Esc+:w saves.
__
(_.\ Marcelo Pereira |
/ / ___ |
/ (_/ _ \__ Matematica/99 - IMECC |
_______\____/_\___)___Unicamp_______________/

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Vince Vielhaber 2002-07-01 12:46:17 Re: PHP + bash script
Previous Message Marcelo Pereira 2002-07-01 12:37:17 PHP + bash script