Re: SQL query to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxxxxxx) 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?




[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux