title: My form only adds one user, I can add another one when i delete the previous user in my database. Anyone has any tips?
body: <p>I know my code looks bad, but I just started using PHP. I can't fix the problem and I have been looking online for hours.</p>
  <pre><code>    $sql = &quot;INSERT INTO user (username, pass) VALUES ('$username', '$pass')&quot;; 
      $sql_check = &quot;SELECT * FROM user WHERE username = '$username'&quot;;
      $res = $conn-&gt;query($sql);
      $res_check = $conn-&gt;query($sql_check);
  
  
      if ($res_check-&gt;num_rows &gt; 0) {
          $melding = &quot;Gebruikersnaam is al in gebruik&quot;;  
      } else if($res) {
          $melding =  &quot;Gebruiker geregistreerd&quot;;
      } else {
          $melding =  &quot;Gebruiker niet geregistreerd&quot;;
      }
  </code></pre>