$con=mysql_connect("localhost","root","q1w2e3r4");

解决方案 »

  1.   

    我写的是机器名,应该好用的,换成localhost也是一样的问题
      

  2.   

    有什么错误信息?数据库里有没有数据? 
    $sql="insert into guestbook(name,fromcity,email,content,time) values($name,$fromcity,$email,$content,$time)";
    改成:
     $sql="insert into `guestbook` (`name`,`fromcity`,`email`,`content`,`time`) values('$name','$fromcity','$email','$content','$time')";
      

  3.   

    那个sql到数据库里面去执行下,看下是否能正确执行
      

  4.   

    if($submit && $name && $content)--------------------------------------------you may not get the posted data here:$submit,...use $_POST['submit']...if($_POST['submit'] && $_POST['name'] && $_POST['content'])or write $name=$_POST['submit']; .... on the top of the php program.