另外,我连数据库的时候还有以下错误,连可以连上,
但出来的时候总跳出来一个
php.exe应用程序错误,“0x77fcc2e2”指令引用的"0x00b20010"内存,该内存不能为“read”
请问各位前辈,这个是怎么回事啊?

解决方案 »

  1.   

    为什么要两句sql语句啊,一句不就够了吗???奇怪!
      

  2.   

    哈哈,没关系,不是两句sql的原因,一句也是上面那个错误,呵呵,大家看看那个到底是什么错误啊
      

  3.   

    $sql="Select * from yhzc  where username="$_POST['name']"";
    ===>
    $sql="Select * from yhzc  where username='{$_POST['name']}'";$sql2="Select password from yhzc where username="$_POST['name']" and  password ="$_POST['password']"";
    ===>
    $sql2="Select password from yhzc where username='{$_POST['name']}' and  password ='{$_POST['password']}'";
      

  4.   

    <?php 
    $username=$_POST['name'];
    $password=$_POST['password'];
    $conn=mssql_pconnect("localhost","sa","1");
    mssql_Select_db("njc2",$conn);
    $sql="Select * from yhzc  where username='$username'";
    $sql2="Select password from yhzc where username='$username' and  password ='$password'";
    $res= mssql_query($sql,$conn);
    $res2=mssql_query($sql2,$conn);
    $row=mssql_num_rows($res);
    $row2=mssql_num_rows($res2);
    if($row==0)
    {echo "登陆失败";}
    else if ($row==1&&$row2==0)
    {echo "登陆失败";}
    else 
    {echo  "登陆成功";}
    ?>两个字段要是字符型的。
      

  5.   

    啊,高手!!!,我知道了,另外各位帮我看看第二楼的那个问题把,搞的我头大死了。一直报php.exe错误。接着就用VC调试。