嗨,我在插入数据库(postgres)时遇到问题:
这是我的input.php(我将其用于连接并插入到DB中):
<?php
$conn = @pg_connect("dbname=postgres user=postgres password=123456789");
if(!$conn) {
die('Connessione fallita !<br />');
} else {
echo 'Connessione riuscita !<br />';
}
// Richiedente
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$testo = $_POST['testo'];
// Interni
if($_POST['iname']) foreach($_POST['iname'] as $iname)
if($_POST['isurname']) foreach($_POST['isurname'] as $isurname)
if($_POST['iemail']) foreach($_POST['iemail'] as $iemail)
// Esterni
if($_POST['ename']) foreach($_POST['ename'] as $ename)
if($_POST['esurname']) foreach($_POST['esurname'] as $esurname)
if($_POST['eemail']) foreach($_POST['eemail'] as $eemail)
//inserting data order
"INSERT INTO prenotazioni (nome_rich, cognome_rich, email_rich,oggetto_rich)
VALUES ('$name','$surname', '$email','$testo')";
"INSERT INTO interni (nome_int, cognome_int, email_int)
VALUES ('$iname','$isurname','$iemail')";
"INSERT INTO esterni (nome_est, cognome_est, email_est)
VALUES ('$ename','$esurname','$eemail')";
?>
我收到此错误:
致命错误:未捕获错误:调用C:\ xampp \ htdocs \ Project \ input.php:6中未定义的函数pg_connect()堆栈跟踪:#0 {main}抛出C:\ xampp \ htdocs \ Project \第6行的input.php