title: Update table as soon as a new database table row is inserted
body: <p>So I want to know how I should make a table, written in PHP 8, that updates as soon a new insert has been made in the database table (SQL Server 2019). I've created a simple table like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;header1&lt;/th&gt;
        &lt;th&gt;header2&lt;/th&gt;
        &lt;th&gt;header3&lt;/th&gt;
      &lt;/tr&gt;
     &lt;/thead&gt;
     &lt;tbody&gt;
       &lt;tr&gt;
         &lt;td&gt;text1.1&lt;/td&gt;
         &lt;td&gt;text1.2&lt;/td&gt;
         &lt;td&gt;text1.3&lt;/td&gt;
       &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>Then I've added a button that creates some input fields, and when these are submitted, the data is inserted into the database. But the only way I know to update the table is to reload the page so the table now has the new row. But I've seen websites that do this without reloading the site, and want to know how? My guess is to make some kind of listener, but how I dont know.</p>
  <p>the submit button with some inputs could be something like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form&gt;
    &lt;input type=&quot;text&quot; id=&quot;html&quot; name=&quot;fav_language&quot; value=&quot;&quot;&gt;
    &lt;label for=&quot;html&quot;&gt;HTML&lt;/label&gt;&lt;br&gt;
    &lt;input type=&quot;text&quot; id=&quot;css&quot; name=&quot;fav_language&quot; value=&quot;&quot;&gt;
    &lt;label for=&quot;css&quot;&gt;CSS&lt;/label&gt;&lt;br&gt;
    &lt;input type=&quot;text&quot; id=&quot;javascript&quot; name=&quot;fav_language&quot; value=&quot;&quot;&gt;
    &lt;label for=&quot;javascript&quot;&gt;JavaScript&lt;/label&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  <p>All this should just be pure self written code, not JQuery or something like that.</p>