Re: postgresql csv import

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


On 16/09/2021 21:30, ourdiaspora wrote:

Please excuse, but very confused the options available; none seem easy to understand. Tried:


Please could someone help to explain why the following code fails:

	$uploaddir = '~/tmp/cpac/cpactmp/';
	$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
	$dbconnect = pg_connect("dbname=cpacweb user=cpaca");
	$targetfilepath = $uploaddir . $uploadfile;
		$dbconnect = "INSERT INTO somedata(name, id, emailaddress, groupname) VALUES ('jane bloggs','1234','jbloggs@some.where','1a1')";
	$query = "SELECT * FROM somedata";
	$result = pg_exec($dbconnect, $query);
	echo "Number of rows: " . pg_numrows($result);

The web page reports:
Number of rows: 0

This suggests successful connection to the database, but some failure to enter new data.

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?
Again, what does your error log tell you?

Ashley Sheridan

[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