当前位置:首页 > PHP教程 > php应用 > 列表

php An error occured

发布:smiling 来源: PHP粉丝网  添加日期:2013-11-28 08:48:50 浏览: 评论:0 
  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. ?> 

Tags: php An error occured

分享到: