title: What is wrong with my PDO request?
body: <p>I am trying to make a simple function for insert array in my database with PDO.</p>
  
  <pre><code>   &lt;?php
  require_once($_SERVER["DOCUMENT_ROOT"] . '/include/config/database.php');
  /**
   * Database
   */
  class Database {
  
      function __construct() 
      {
  
      }
      function insertArray($array, $table)
      {
          global $bdd;
          $i = 1;
  
          foreach ($array as $key =&gt; $currVal) 
          {
              if ($i == count($array))
                  $keyVal .= ':'.$key;
              else
                  $keyVal .= ':'.$key.', ';
              $i++;
          }
          $arrayKeyValue = implode(", ", array_keys($array));
          $req = $bdd-&gt;prepare('INSERT INTO '.$table.'('.$arrayKeyValue.') VALUES('.$keyVal.')');
          $req-&gt;execute($array);
          die('DONE');
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>But no data is inserted and i don't have any error in php or with pdo error...</p>
  
  <p>Someone know what i make wrong?</p>
  
  <p>thanks</p>
  
  <p>PS: Sorry for my bad English</p>
  
  <p>SQL setting &amp; connection</p>
  
  <pre><code>   &lt;?php
  error_reporting(E_ALL);
  $bdd = new PDO('mysql:host=localhost;dbname=csgo', 'csgo', 'password removed', array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt; 'SET NAMES utf8', PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING));
  ?&gt;
  </code></pre>
  
  <p>variable content:</p>
  
  <pre><code>$array 
  array(5) {
    ["screen_name"]=&gt;
    string(4) "test"
    ["avatar_big"]=&gt;
    string(15) "test_avatar.png"
    ["avatar_small"]=&gt;
    string(16) "small_avatar.png"
    ["steam_id"]=&gt;
    int(991)
    ["last_connection"]=&gt;
    int(156121)
  }
  $keyVal
  string(69) ":screen_name, :avatar_big, :avatar_small, :steam_id, :last_connection"
  $arrayKeyValue
  string(64) "screen_name, avatar_big, avatar_small, steam_id, last_connection"
  </code></pre>
  
  <p>SQL request:</p>
  
  <pre><code>INSERT INTO user(screen_name, avatar_big, avatar_small, steam_id, last_connection) VALUES(:screen_name, :avatar_big, :avatar_small, :steam_id, :last_connection)
  </code></pre>