title: mysqli returns true for INSERT query, row not inserted
body: <pre><code> if ($word != '' &amp;&amp; $text != '') {
      $result = $conn-&gt;query("SELECT * FROM variables WHERE `word` = '$word'");
      if ($source = $result-&gt;fetch_assoc()) {
          $conn-&gt;query("UPDATE variables SET `text` = '$text' WHERE `word` = '$word'");
          echo 0;
      } else {
          if ($result = $conn-&gt;query("INSERT INTO variables (`word`, `text`) VALUES ('$word', '$text')"))
              echo 1;
      }
  }
  </code></pre>
  
  <p>The above is the INSERT code (and update) the UPDATE code works fine, however when the INSERT query is called the query returns <code>true</code> but when i check the data, it hasn't been inserted. </p>
  
  <p>Any help is appreciated, thanks in advance.</p>
  
  <p>EDIT:</p>
  
  <p>variables table structure:</p>
  
  <pre><code>`word` varchar(100) NOT NULL, //also PRIMARY KEY
  `text` text NOT NULL
  </code></pre>