title: Can't do mysql insert on ubuntu
body: <p>I recently uploaded my site from my pc to ubuntu with ssh.<br>
  Before I uploaded it worked fine with xampp.<br>
  Now everything else is working but mysql insert query.<br>
  Connect is working and mysql update. Nothing in mysql <code>error.log</code>.</p>
  
  <p>Select is working too.</p>
  
  <p>This is not working</p>
  
  <pre><code>$user_query = $db-&gt;prepare("INSERT INTO users (id, userid, name) VALUES (:id, :userid, :name)");
  if($url_query-&gt;execute(array(":id" =&gt; "", ":userid" =&gt; $userid, ":name" =&gt; $name))){
      header("location: /");
  }
  </code></pre>
  
  <p>This is working</p>
  
  <pre><code>$user_query = $db-&gt;prepare("UPDATE users SET name=:name WHERE userid =:userid");
  if($user_query-&gt;execute(array(":name" =&gt; $name, ":userid" =&gt; $userid))){
      header("location: /");
  }
  </code></pre>
  
  <p>I don't see any difference between these two querys.  </p>
  
  <p>Table</p>
  
  <pre><code>+----------+---------+------+-----+---------+----------------+
  | Field    | Type    | Null | Key | Default | Extra          |
  +----------+---------+------+-----+---------+----------------+
  | id       | int(11) | NO   | PRI | NULL    | auto_increment |
  | userid   | text    | NO   |     | NULL    |                |
  | name     | text    | NO   |     | NULL    |                |
  +----------+---------+------+-----+---------+----------------+
  </code></pre>
  
  <p>My host is from digitalocean and I used <a href="https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04" rel="nofollow noreferrer">this</a> when I installed my apache and mysql</p>
  
  <pre><code>$user_query = $db-&gt;prepare("SELECT id FROM users WHERE userid=:userid");
      if($user_query-&gt;execute(array(":userid" =&gt; $userid))){
          if($user_query-&gt;rowCount()){
  
              $user_query = $db-&gt;prepare("UPDATE users SET name=:name WHERE userid =:userid");
              if($user_query-&gt;execute(array(":name" =&gt; $name, ":userid" =&gt; $userid))){
                  header("location: /");
              }
  
          } else {
  
              $user_query= $db-&gt;prepare("INSERT INTO users (id, userid, name) VALUES (:id, :userid, :name)");
              if($user_query-&gt;execute(array(":id" =&gt; "", ":userid" =&gt; $userid, ":name" =&gt; $name))){
                  header("location: /");
              }
          }
      }
  </code></pre>