<?php    require_once('Connections/conn.php');
$conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
mysql_select_db("user",$conn)or die("can't connect to the servers");  
  $reback=0;
  $sql="select * from user where name="'.$_GET['user'].'"";
  $rst=$conn->Execute($sql)or die('execute error');
  if($ret->RecordCount()==1)
{
  $reback='2';  
  }    else
{  
  $reback='1';   
  }     echo $reback;  
?>提示$rst=$conn->Execute($sql)or die('execute error'); 这行有问题
Call to a member function Execute() on a non-object 

解决方案 »

  1.   

    <?phprequire_once('Connections/conn.php');
    $conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
    mysql_select_db("user",$conn)or die("can't connect to the servers");
    $reback=0;
    $sql="select * from user where name='".$_GET['user']."'";
    $rst=mysql_query($sql)or die('execute error'); //用mysql_query
    if($ret->RecordCount()==1)
    {
    $reback='2';
    }else
    {
    $reback='1';
    }echo $reback;?>
      

  2.   

    多谢楼上的。不过if($ret->RecordCount()==1)
    这行又出问题了- -·
      

  3.   

    <?phprequire_once('Connections/conn.php');
    $conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
    mysql_select_db("user",$conn)or die("can't connect to the servers");
    $reback=0;
    $sql="select * from user where name='".$_GET['user']."'";
    $rst=mysql_query($sql)or die('execute error'); //用mysql_query
    if(while ($row = mysql_fetch_assoc($rst)){
    $reback='2';
    }else{
    $reback='1';
    }echo $reback;?>
    你要去看PHP手册上的例子
      

  4.   

    上面写错了,改一下
    <?phprequire_once('Connections/conn.php');
    $conn=mysql_connect("localhost","root","root")or die("不能连接到数据库");
    mysql_select_db("user",$conn)or die("can't connect to the servers");
    $reback=0;
    $sql="select * from user where name='".$_GET['user']."'";
    $rst=mysql_query($sql)or die('execute error'); //用mysql_query
    while ($row = mysql_fetch_assoc($rst)){
    print_r($rst);
    }echo $reback;?>
      

  5.   

    看书,不如看PHP手册http://www.php.net/manual/en/function.mysql-query.php
      

  6.   

    不好意识。我这依然报错~~ 还是if(while ($row = mysql_fetch_assoc($rst)){这句
      

  7.   

    能加你QQ或直接联系吗·我这就一个小项目 。QQ450227336
      

  8.   

    $sql="select * from user where name="'.$_GET['user'].'"";
    把这句改成:
    $sql="select * from user where name='".$_GET['user']."'";
    注意单引号和双引号的位置。
    或者干脆这样:
    $sql="select * from user where name='{$_GET['user']}'";
      

  9.   

    ="'.$_GET['user'].'"";
    单引号还能放单引号啊...
      

  10.   

    '".$_POST[]."'