title: Illegal string offset 'id'
body: <p>I'm working in a login system on my website and I'm stuck.
  Here my code</p>
  
  <pre><code>if(!empty($_SESSION['pseudo']))
      {
          $pseudo = Securise($_SESSION['pseudo']);
          try
          {
              $sql = $DB-&gt;query("SELECT * FROM users WHERE pseudo = '".$pseudo."' LIMIT 1");
  
          }catch (Exception $e){
              die('Error: ' . $e-&gt;getMessage());
          }
          $row_count = $sql-&gt;rowCount();
  
          if($row_count &gt; 0)
              {
                  $req = $DB-&gt;query("SELECT * FROM users WHERE pseudo = '".$pseudo."' LIMIT 1");
                  $user = $req-&gt;fetchColumn();
                  $up = $DB-&gt;query("UPDATE users SET last_ip = '".$_SERVER["REMOTE_ADDR"]."' WHERE id = '".$user['id']."'");
              }
              else {
              session_destroy();
              Redirect("".$lien."");
              exit();
              }
      }
  </code></pre>
  
  <p>I get an error at the following line</p>
  
  <pre><code>$up = $DB-&gt;query("UPDATE users SET last_ip = '".$_SERVER["REMOTE_ADDR"]."' WHERE id = '".$user['id']."'");
  </code></pre>
  
  <p>I can't figure out why Php give me a
  "Warning: Illegal string offset 'id"</p>