title: Check if username already exists in database
body: <p>I'd like to make an if statement that checks if the username, already exists in the MYSQL database. I tried some different stuff, but i cant make it work. Every time I test it in my browser I get a notice </p>
  
  <blockquote>
    <p>Notice: Undefined index: username in etc.</p>
  </blockquote>
  
  <p>I am confused if it has anything to do with the $result variable or the $check variable or neither.</p>
  
  <p>Here is the HTML form and the PHP script.
  <a href="https://gist.github.com/anonymous/9704354" rel="nofollow noreferrer">https://gist.github.com/anonymous/9704354</a></p>
  
  <p>Thank you and have a nice weekend!</p>