$note = str_replace ( " ","&nbsp", $note); $note = str_replace ( "\n",  "<br>", $note); 这里做了替换,所以就有空格、空行

解决方案 »

  1.   

    每次进入就插入一条记录
    $sql= "insert  into $mytable(name, topic,email,note,tel) values('$name' , '$topic' ,  '$email' ,  '$note',  '$tel'  )";
    $sql_result=mysql_query($sql,$link);
    if(!$sql_result)
      echo"wrong";
    然后再查询
    $query="select key_liuyan, name,topic, email, note,tel  from $mytable ";  
    $query_result=mysql_query($query,$link);
    当然要有许多空行了
      

  2.   

    $note = str_replace ( " ","&nbsp", $note); $note = str_replace ( "\n",  "<br>", $note); 

    以上这段程序是为了使输出的内容保持用户的格式,例如空格等。
    我刚把它去掉了,可是再输入数据时还是有许多空行?怎麽办呢?