Heim  >  Artikel  >  Backend-Entwicklung  >  php An error occured_PHP教程

php An error occured_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:52:251440Durchsuche

function install_postgresql($name, $mail, $title, $content){

$pgsql_conn = pg_connect("host=localhost port=5432 dbname=book user=vi");
if (!$pgsql_conn) {
   echo "connect database error.\n";
   exit;
}

$result = pg_query($pgsql_conn, "INSTER INTO topic (man, mail, title, content) VALUES ('$name', '$mail', '$title', '$content');");
if(!$result){
        echo "An error occured.\n";
        exit;
}

pg_close($pgsql_conn);
}
?>

注要是你在sql后面加了;号,去了就行了,

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/632496.htmlTechArticle?php function install_postgresql($name, $mail, $title, $content){ $pgsql_conn = pg_connect(host=localhost port=5432 dbname=book user=vi); if (!$pgsql_conn) { echo connect database...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn