title: Stop SQL from inserting duplicates (php)
body: <p>It seems to be impossible to do this just with SQL statements, so I wrote a php check, which is completely ignored by the script. $resourse array holds the right data.</p>
  
  <pre><code>public function handleUpdates($updates) {
  
      $stmt = $this-&gt;database-&gt;connect()-&gt;prepare("SELECT ? FROM users"); //&lt;-
      $stmt-&gt;execute(["username"]); //&lt;-
      $resource = $stmt-&gt;fetch(PDO::FETCH_ASSOC); //&lt;-
  
      foreach ($updates["result"] as $update) {
  
          $text = $update["message"]["text"];
          $args = $update["message"]["chat"]["username"];
  
          if ($text === "/start") {              
              if ($resource['username'] !== $args) //this here is ignored
                  $this-&gt;database-&gt;add($args); 
          }
      }
  }
  </code></pre>