title: PHP MYSQL Couldn't execute query: Unknown column
body: <p>Please help me to figure out this. The first query would return a message saying that  </p>
  
  <pre><code>Couldn't execute query: Unknown column 'ssd23' in 'where clause.
  </code></pre>
  
  <p><code>ssd23</code> is the value the <code>$_POST</code> will get for the pnumber from a html form. However, it would work if there are only digits.</p>
  
  <pre><code>$result = mysqli_query($con, "DELETE FROM Tools WHERE PartNumber = {'$_POST['pnumber']'}") or die ("Couldn't execute query: " .mysqli_error($con));
  </code></pre>
  
  <p>This second query below would work with both digits and characters after using a variable.</p>
  
  <pre><code>$test = $_POST['pnumber'];                  
  $result = mysqli_query($con, "DELETE FROM Tools WHERE PartNumber = '$test'") or die ("Couldn't execute query: " .mysqli_error($con)); 
  </code></pre>