/**
 * A class file to connect to database
 */
class DB_CONNECT {
	
	// constructor
	function __construct() {
		// connecting to database
		$this->connect();
	}
	
	//destructor
	function __destruct() {
		// closing db connection
		$this->close();
	}
	
	/**
	 * Function to connect with database
	 */
	function connect() {
		// import database connection variables

    define('DB_USER', "root");//user name
	define('DB_PASSWORD',"root");// db password
	define('DB_DATABASE',"mydb");// database name
	define('DB_SERVER', "localhost");// db server
 		// Connecting to mysql database
		$conn = mysqli_connect(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
		// Check connection
 		if (!$conn) {
			die("Connection failed: " . mysqli_connect_error());
		} 
		// returing connection cursor
		return  $conn ;
	}
	
	/**
	 * Function to close db connection
	 */
	function close() {
		// closing db connection
		mysqli_close($this->connect());
	}
}





// include db connect class
require_once  'db_connect.php';

// connecting to db
$db = new DB_CONNECT();
$conn = $db->connect();


$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$remember = $_REQUEST['remember'];

if(isset($username) && isset($password ))
{	
		$query = "SELECT * FROM user WHERE username = '$username' and password = '$password' AND isactive = 1";
		
    $check = $conn->query($query);			
    if($check->num_rows > 0)
    {

    echo "Login Successfully";
    
    }


}




Result

Login Successfully