class Login{ public $conn; public $u; public $p; public function __construct($u,$p){ $this->u=$u; $this->p=$p; $this->conn=mysqli_connect("192.192.192.7","userTest","userTest123123","wmshd"); $this->conn->query('SET NAMES UTF8'); } public function login(){ $sql="SELECT password,db FROM setting_user WHERE user='".$this->u."'"; $q=$this->conn->query($sql); $r=$q->fetch_array(MYSQLI_USE_RESULT); if($this->p==$r["password"]){ return $r["db"]; }else{ return 0; }//if }//login }//
php面向对象编程登陆类
阅读:3987 输入:2014-05-22 07:02:15