title: Notice: A session had already been started - ignoring session_start() in C:\xampp\htdocs\teller\fungsi.php on line 2
body: <p>i get a notice <br></p>
  
  <pre><code>Notice: A session had already been started - ignoring session_start() in C:\xampp\htdocs\teller\fungsi.php on line 2
  Notice: Use of undefined constant status - assumed 'status' in C:\xampp\htdocs\teller\fungsi.php on line 17
  Notice: Use of undefined constant status - assumed 'status' in C:\xampp\htdocs\teller\fungsi.php on line 20
  </code></pre>
  
  <p>in my code. I try this function in the old my sql version was success. but in my sql versi 5.5.16 it doesn't work. 
  this is my source code :</p>
  
  <pre><code>&lt;?php 
  session_start();
  function ver_user($username,$password)
  {
      mysql_connect('localhost', 'root', '');
      mysql_select_db('teller');
      if (!empty($username)) 
          {
              $query="SELECT * FROM `user` WHERE `username`='$username'";
              $action=mysql_query($query);
              $data=mysql_fetch_array($action);
              $passmd5=md5($password);
              if ($data['password']==$passmd5)
                  {
                      $_SESSION['username']=$username;
                      $_SESSION['password']=$password;
                      if ($data[status]==1){
                          $data['0']="valid";
                      }
                      if ($data[status]==2) {
                          $data['0']="valid1";
                      }   
                      return $data;
                  }
              else 
                  {
                      $data['0']="invalid";
                      return $data;
                  }
          }
  }
  function logout()
  {
      session_destroy();
  }
  ?&gt;
  </code></pre>