您当前的位置: 主页 > 常见问题 >

php An error occured

更新时间:2017-03-03 16:59  来源:未知

<?phpfunction 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后面加了;号,往了就好了,