WRONG USERNAME OR PASSWORD
<p>I Cannot login.When click button login its show WRONG USERNAME OR PASSWORD.The db is id,username,password and level.  SELECT <code>id</code>, <code>username</code>, <code>password</code>, <code>level</code> FROM <code>login</code></p>

<pre><code>&lt;?php
ob_start();
$message = "";
if ( isset ($_POST['login']))
  {
   include 'admin/dbconnect.php';
   $username = $_POST['username'];
   $password = $_POST['password'];
   if ($username != "" &amp;&amp; $password != "")
   {

    $sql = "SELECT * FROM login WHERE username = '$username' and password = '$password' ";
    $result = mysql_query($sql) ;
    $row = mysql_fetch_array($result, MYSQL_ASSOC);
    if (mysql_num_rows($result) ==1)
    {
        session_start();
        $_SESSION['isLogged_in'] = true;
        $_SESSION['username'] = $row['username'];
        $_SESSION['level'] = $row['level'];
        $message = 'Logged-in successfully';
        }
        else
        {
            $message = 'WRONG USERNAME OR PASSWORD';
        }
    }

    else
    {
        $message = 'PLEASE RE-INPUT YOUR USERNAME AND PASSWORD';
    }
    }


    ?&gt;
</code></pre>
