<?php
require_once('db.php');
$nickname = $_POST['nickname'];
$password = $_POST['password'];
if(empty($nickname) || empty($password)){
    echo 'complete all fields';
} else{
    $sql = "SELECT * FROM `nickname` WHERE nickname = '".$nickname."' AND password = '".$password."'";
    $result = $conn->query($sql);
    if ($result -> num_rows> 0){
        while($row = $result -> fetch_assoc()){
            echo 'well come'. $row['nickname'];
        }
    } else {
        echo'incorrect user';
    }
}