Re: SQL query to a file

From: dan radom <dan(at)radom(dot)org>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: SQL query to a file
Date: 2002-07-01 12:58:20
Message-ID: 20020701125820.GT25268@lunar.radom.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

you can use the PHP touch and fopen functions and then write the rows to the file using a for loop.

dan

* Marcelo Pereira (gandalf(at)sum(dot)desktop(dot)com(dot)br) wrote:
> 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?

In response to

Responses

Browse pgsql-php by date

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