title: delete entire table
body: <p>Please bear with me, I am quite new at PHP, so I am not so good yet. I am trying to make a button, which has the function that can delete all rows in MySQL database. </p>
  
  <p>I have two columns in my numtable: "n_id(primary key)" and "num". They are both INT. </p>
  
  <p>As it is now I have filled out 3 values in MySQL database:</p>
  
  <pre><code>n_id   num
  1       4
  2       9
  3       47
  </code></pre>
  
  <p>index.html:</p>
  
  <pre><code>&lt;form method = "post" action = "delete.php"&gt;
      &lt;input name="delete" type="submit" id="delete" value="Delete"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>delete.php:</p>
  
  <pre><code>$query = ("DELETE FROM numtable WHERE id="delete");
  </code></pre>
  
  <p>I have looked a lot around stack overflow, but I can only find questions, where it is a single row there has to be deleted, and not the entire table. My code is definitely wrong, but what is it that I need more? </p>
  
  <p>I can see that it is also a possibility to use <code>TRUNCATE</code> instead of <code>DELETE</code> in the SQL query. As I understand it, it is best to use <code>TRUNCATE</code> if the database has very big data, and delete if the database is not so big. Is that correct?  </p>