Re: postgresql csv import

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

 



On Thursday, September 16th, 2021 at 9:30 PM, ourdiaspora <ourdiaspora@xxxxxxxxxxxxxx> wrote:
>
> sudo nano /etc/php/7.0/apache2/php.ini
>
> "
>
> ...
>
> [line number]483 log_errors = On
>
> ...
>
> 571 error_log = ~/tmp/webserver/phperrors.log
>
> ...
>
> The directory does not show creation of such an error file to interrogate further. Please what next to investigate?

Readers,

Continuation of failures occurs:

<?php
	$uploaddir = '~/tmp/cpac/cpactmp/';
	$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
	$dbconnect = pg_connect("dbname=cpacweb user=cpaca");
	$targetfilepath = $uploaddir . $uploadfile;
	if(isset($_POST["submit"])){
		$filename=$_FILES["userfile"]["tmp_name"];
		if($_FILES["file"]["size"] > 0){
			$file = fopen($filename, "r");
			while (($getdata = fgetcsv($file, 10000, ",")) !== FALSE){
				$dbdataentry = "INSERT INTO somedata(name, id, emailaddress, groupname) VALUES ('".$getdata[0]."','".$getdata[1]."','".$getdata[2]."','".$getdata[3]."')";
				}
			$result = pg_query($dbconnect, $dbdataentry);
			}
			fclose($file);
		 }
	$query = "SELECT * FROM somedata";
	$result = pg_exec($dbconnect, $query);
	echo "Number of rows: " . pg_numrows($result);
	pg_freeresult($result);
	pg_close($dbconnect);
?>

Connection to the database is successful, but not csv import and subsequent data entry.

As posted previous, also do not understand why error logs are not being produced. Please what to do?

The file 'phpinfo()' shows:
"
...
error_log	-1	-1
...
"

The error log is not produced.




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux