Código PHP:
<?php
class Login{
protected $connect;
protected $username_i;
protected $password_i;
public function __construct($username,$password){
$this->connect = query("SELECT username,password FROM username WHERE username = '".mysqli_real_espace_string($this->connect, $username)."' AND password = '".mysqli_real_espace_string($this->connect, $password)."'");
$this->username_i = $username;
$this->password_i = $password;
}
private function verificar(){
$verificar = array(
'verificado' => 'yes',
);
if($this->connect1 = mysqli_fetch_assoc($this->connect)){
$verificar['verificado'] = 'yes';
}else{
$verificar['verificado'] = 'no';
}
return $verificar['verificado'];
}
}
class MySQL extends Login{
public $connect;
public function __construct(){
$this->connect = mysqli_connect("...","...","...","...");
return $this->connect;
}
public function query($query){
mysqli_query($this->connect, $query);
return $query;
}
}
?>