字段id的类型?
做非seslect操作时mysql_query是返回sql串本身是否有错误
检查插入是否成功要通过mysql_affected_rows函数

解决方案 »

  1.   

    $strsql="select * from reguser";你执行的是这句,当然没有插入了,php对变量大小写是敏感的,你的插入语句赋给的这个$strSql变量S是大写的,所以没有执行,还有建议你最好做个条件判断,不然不管你执行成功与否,都会输出这句:您已经成功注册成我们的会员!
      

  2.   

    整理完毕后 代码如下:
    <?php
    $myconn=mysql_connect("localhost","root","123456");
    mysql_select_db("test",$myconn);
    $strSql="insert into reguser(id,userid,sex,age,tel,email,address)
     values('3','hison','man','22','2687826','[email protected]','beihai')";
    $result=mysql_query($strsql,$myconn) or die(mysql_error());
            mysql_close($myconn);
            echo "<br><br>您已经成功注册成我们的会员!";
    ?>这个输出的结果是:您已经成功注册成我们的会员!可是用PHPMYADMIN打开数据库时 却没有这个记录 这个到底是什么问题呢
      

  3.   

    我觉得会不会是设置权限的问题呢 我用的XP SP2 文件格式用NTFS的
      

  4.   

    你必须对sql执行结果进行判断,如果执行正确的话,它会返回ture.
    所以可以用if($result)进行判断。
    修改后语句如下:
    <?php
    $myconn=mysql_connect("localhost","root","123456");
    mysql_select_db("test",$myconn);
    $strSql="insert into reguser(id,userid,sex,age,tel,email,address)
     values('3','hison','man','22','2687826','[email protected]','beihai')";
    $result=mysql_query($strsql,$myconn) or die(mysql_error());
    if($result){echo "<br><br>您已经成功注册成我们的会员!";}
    else{echo "不成功!";}
    mysql_close($myconn);
    ?>
      

  5.   

    我帮你整好了:
    <?php
    $myconn=mysql_connect("localhost","root","123456");
    mysql_select_db("test",$myconn);
    $strSql="insert into reguser(id,userid,sex,age,tel,email,address)
     values('3','hison','man','22','2687826','[email protected]','beihai')";
    $result=mysql_query($strSql,$myconn) or die(mysql_error());
           mysql_close($myconn);
            echo "<br/><br/>您已经成功注册成我们的会员!";
    ?>
      

  6.   

    已经说过了!php对变量大小写敏感!楼主没看到?