首页 > 开发 > PHP > 正文

php An error occured

2024-05-04 21:56:18
字体:大 中 小
来源:转载
供稿:网友
  1. <?php 
  2. function install_postgresql($name, $mail, $title, $content){ 
  3.  
  4. $pgsql_conn = pg_connect("host=localhost port=5432 dbname=book user=vi"); 
  5. if (!$pgsql_conn) { 
  6.    echo "connect database error./n"; 
  7.    exit; 
  8. } 
  9.  
  10. $result = pg_query($pgsql_conn, "INSTER INTO topic (man, mail, title, content) VALUES ('$name', '$mail', '$title', '$content');"); 
  11. if(!$result){ 
  12.         echo "An error occured./n"; 
  13.         exit; 
  14. } 
  15.  
  16. pg_close($pgsql_conn); 
  17. } 
  18. ?> 

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表