title: PHP SQL-Injection not working
body: <p>my problem is that my SQL-Injection isnt working. My normal login and registration is working as intended, but this important part isnt.</p>
  
  <pre><code>&lt;?php
  
  $connection = mysqli_connect('localhost', 'root', '', 'DB') or die(mysqli_error());
  mysqli_select_db($connection, 'DB') or die(mysqli_error());
  
  @$Vorname = $_POST['vorname'];
  @$Nachname = $_POST['nachname'];
  @$Passwort = $_POST['passwort'];
  
  @$Vorname2 = $_POST['vorname2'];
  @$Nachname2 = $_POST['nachname2'];
  @$Passwort2 = $_POST['passwort2'];
  
  if ($Vorname != Null &amp;&amp; $Passwort != Null &amp;&amp; $Nachname != Null) {
      $sql1 = "INSERT INTO Persons VALUES('$Vorname', '$Passwort', '$Nachname')";
      $query1 = mysqli_query($connection, $sql1) or die(mysqli_error());
      $remove = array("page");
  }
  
  if ($Vorname2 != Null &amp;&amp; $Passwort2 != Null &amp;&amp; $Nachname2 != Null) {
      $sql2 = "SELECT * FROM Persons WHERE Vorname = '$Vorname2' AND Passwort = '$Passwort2' AND Nachname = '$Nachname2'";
      $query2 = mysqli_query($connection, $sql2) or die(mysqli_error());
  
      $row = mysqli_fetch_array($query2, MYSQLI_ASSOC);
      $active = $row;
      $count = mysqli_num_rows($query2);
  
      if ($count == 1) {
          echo "Login sucessful";
      } else {
          echo "Login failed";
      }
  }
  $remove = array("page");
  
  ?&gt;
  </code></pre>
  
  <p>When im now inputting xxx' OR 1=1;-- or something similar in the login window, its just showing Login Failed its driving me crazy.</p>
  
  <p>Thank you for your time and i hope my question is clear, have a nice day.</p>