title: How can I remove white spaces in a psql insert?
body: <p>I have a text input:</p>
  <pre><code>&lt;label for=&quot;pt&quot;&gt;&lt;b style=&quot;color:white&quot;&gt; Company name &lt;/b&gt;&lt;/label&gt;
          &lt;input type=&quot;text&quot; name=&quot;company&quot; maxlength=&quot;100&quot; required&gt;
  </code></pre>
  <p>And I want to insert into a psql database:</p>
  <pre><code>$comp= $_POST[&quot;company&quot;];
  $comptr = trim($comp);
  </code></pre>
  <p>When I have inserted it nothing happened. The data in the table remained the same with multiple whitespaces</p>
  <p>here is the insert:</p>
  <pre><code>$queryres = &quot;insert into company (v1, v2, ...) VALUES ('$comptr ','$v2', ...)&quot;;  
  $resultsel = pg_query($con, $queryres);
  </code></pre>
  <p>Example:</p>
  <p>I wrote this in the input:</p>
  <pre><code>  &quot;     TEST     COMP.  &quot;
  </code></pre>
  <p>in the table stayed this:</p>
  <pre><code>&quot;     TEST     COMP.  &quot;
  </code></pre>
  <p>and I want to change to this:</p>
  <pre><code>&quot;TEST COMP.&quot;
      
  </code></pre>