Search Postgresql Archives

Re: use fopen unknown resource

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

 



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, August 27th, 2021 at 11:10 PM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> 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.

So far have written:
"
<?php
	$userfile=file(./
	$dbusertemporary = pg_connect("dbname=cpacweb user=cpaca");
	$usertemporarydata = pg_copy_from (
		resource $dbusertemporary,
		string $userdata,
		array $rows,
		string $delimiter = ',',
		string $null_as = '\\N'
		): array;
"

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)

Instead of:
"
...
fopen("test.csv", "r"))
...
"

it would _not_ be possible to write, correct?:
"
...
fopen("", "r"))






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux