<? 
require ("config.php");
$sql="select Id from userinfor where Id='$name'";
if($mysql_num_row($mysql_query($sql))>=1)
{
echo'用户存在';
exit;
}
$query="insert into userinfor(Id,Password) values('$name','$Password')";
@$result=mysql_query($query);      if ($result)
  {
  echo "<font color=red>恭喜您!添加成功!</font>";
  }
     else
     {
          echo "<font color=red>添加失败!系统正在返回,请稍候...</font>";
          echo "<meta http-equiv='refresh' content='2; url=user.php'>";  
      }
?>

解决方案 »

  1.   

    我是  SB  哈哈哈应该是$sql="select Id from userinfor where Id='$name'";
    if(mysql_num_row(mysql_query($sql))>=1)
    {
    echo'用户存在';
    exit;
    }
      

  2.   

    Fatal error: Call to undefined function: () in /var/www/load/useradd.php on line 142
      

  3.   

    if(mysql_num_rows(mysql_query($sql))>=1)
      

  4.   

    $sql="select Id from userinfor where Id='$name'";
    if(mysql_num_row(mysql_query($sql))>=1)
    {
    echo'用户存在';
    exit;
    }