Re: use fopen unknown resource

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: ourdiaspora <ourdiaspora(at)protonmail(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: use fopen unknown resource
Date: 2021-08-28 16:52:45
Message-ID: aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/27/21 3:50 PM, ourdiaspora wrote:
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Friday, August 27th, 2021 at 11:10 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
>> https://www.php.net/manual/en/pdo.pgsqlcopyfromfile.php
>>
>
> "
> public PDO::pgsqlCopyFromFile(
> string $table_name,
> string $filename,
> "
>
> Sorry but do not understand; the line does not explain what to write in the php file.

I'm not a PHP programmer, but I'm going to say it is filename as
described here:

https://www.php.net/manual/en/function.fopen.php

" filename

If filename is of the form ...
"

> The plan is to write an html file for a user to select a csv file to import into a database. The manual suggests that the file name is already known (e.g. https://www.php.net/manual/en/function.fgetcsv.php)

You are asking the user to select a file, so there should be some sort
of file reference at that point, correct?

Same for below.

>
> Instead of:
> "
> ...
> fopen("test.csv", "r"))
> ...
> "
>
> it would _not_ be possible to write, correct?:
> "
> ...
> fopen("", "r"))
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2021-08-28 17:11:23 Re: use fopen unknown resource
Previous Message Adrian Klaver 2021-08-28 16:18:52 Re: Unexpected block ID found when reading data