我创建了一个表单来将文件导入我的数据库postgessql,但是我有这个错误:
代码是:
<?php
$name = $_FILES['fichier']['name'];
//$raster = pg_escape_string($_POST['fichier']);
$db = pg_connect('host=localhost port=5432 dbname=gisdb user=**** password=*****');
$output = shell_exec('raster2pgsql -a -s 32629 -I -C -M $_FILES["fichier"]["tmp_name"] eau_param_hydro | psql -U postgres -d gisdb -h localhost -p 5432 ');
// $query = "INSERT INTO eau_param_hydro(rast,filname) VALUES('".$output."','".$name."')";
$result = pg_query($db,"INSERT INTO eau_param_hydro(rast,filename) VALUES('.$output.','.$name.');");
if (!$result) {
$errormessage = pg_last_error();
echo "Error with query: " . $errormessage;
exit();
pg_close();
?>