$query='Select * from authorized_users where name= "'.$userid.'" and password=sha1("'.$password.'")';
这样写对吗?

解决方案 »

  1.   

    $query="Select * from authorized_users where name= '$userid' and password='{sha1($password)}'";
      

  2.   

    $query='Select * from authorized_users where name= "'.$userid.'" and password=sha1("'.$password.'")';
    语法正确,但可读性不强$query="Select * from authorized_users where name='$userid' and password=sha1('$password')";
    这样是不是清爽些?
      

  3.   

    你们说的对的,我是初学,结果表名写错了。sorry!!!!