1

警告:mysql_connect() [function.mysql-connect]:在“读取初始通信数据包”时丢失与 MySQL 服务器的连接,系统错误:第 7 行 C:\AppServ\www\phpdemo\newssave.php 中的 0

<?php 
    include"setup.php";

    $anonym=$_Post["anonym"];
    $sub=$_Post["sub"];
    $content=$_Post["content"];

    $sql= "insert into $newstable values('id','$anonym','$sub','$content');";
    $connect= mysql_connect($DB_SERVER,$DB_USER,$DB_PASS)or die("CONNECT WORNG");
    $db=mysql_select_db($DB_Name,$connect)or die("WORNG");
    $query= mysql_query($sql,$connect)or die("CONNECT WORNG");

    if(!$query) {
        print "POST ERROR";
    }
    else {
      print "post *** ok!";
    }
?>
4

0 回答 0