pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: ourdiaspora <ourdiaspora@protonmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: use fopen unknown resource
Date: Sat, 28 Aug 2021 09:52:45 -0700
Message-ID: <aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com> (raw)
In-Reply-To: <FPQBkGZpsb1CdQX5UIFJTWTaTpYa6spcn_LR3KD6ylvpyWRerxZ9O19SP0zICAwtxta9Wzq5vc1VfKdlWVUXUy8kMaL8OzwbElhBB31WszQ=@protonmail.com>
References: <IrQH-v4UQGJ7mcslUIQnwwlMMpX8GGztHmZDKsBJbwFxhJyo_AYOTbzUug8pVzzvXjq7xfBB7MfPmvy1OcAB1Z5LjMoynM-PFYNP58c_IaI=@protonmail.com>
	<d7b0f1c6-33b9-38f9-7a28-41e773ef7eee@aklaver.com>
	<FPQBkGZpsb1CdQX5UIFJTWTaTpYa6spcn_LR3KD6ylvpyWRerxZ9O19SP0zICAwtxta9Wzq5vc1VfKdlWVUXUy8kMaL8OzwbElhBB31WszQ=@protonmail.com>

On 8/27/21 3:50 PM, ourdiaspora wrote:
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On Friday, August 27th, 2021 at 11:10 PM, Adrian Klaver <adrian.klaver@aklaver.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.klaver@aklaver.com





view thread (8+ messages)  latest in thread

Message-ID: <aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com>
Permalink:  ../aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com/
Also on:    postgresql.org/message-id/aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, ourdiaspora@protonmail.com
  Subject: Re: use fopen unknown resource
  In-Reply-To: <aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com>
  References: <IrQH-v4UQGJ7mcslUIQnwwlMMpX8GGztHmZDKsBJbwFxhJyo_AYOTbzUug8pVzzvXjq7xfBB7MfPmvy1OcAB1Z5LjMoynM-PFYNP58c_IaI=@protonmail.com> <d7b0f1c6-33b9-38f9-7a28-41e773ef7eee@aklaver.com> <FPQBkGZpsb1CdQX5UIFJTWTaTpYa6spcn_LR3KD6ylvpyWRerxZ9O19SP0zICAwtxta9Wzq5vc1VfKdlWVUXUy8kMaL8OzwbElhBB31WszQ=@protonmail.com> <aeec715f-7a02-b68b-823f-81040be4a913@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox