title: mysql_insert_id() echos 0
body: <p>I am not the first to have this problem but the solutions of the others don't work.
  This script always returns 0 for mysql_insert_id(); I am using multiple primary keys.</p>
  
  <pre><code>$sql = "INSERT INTO Produkte (Name,Price,Description,User)
  VALUES ('".$_POST['name']."','".$_POST['price']."','".$_POST['description']."','".$_SESSION['user']."');";
  $result = $GLOBALS['DB']-&gt;query($sql);
  echo mysql_insert_id();
  echo '&lt;div class="saving"&gt;';
  if($result){
  echo "Saved!";
  } else{
  echo("Saving failed");
  } echo '&lt;/div&gt;';
  } 
  </code></pre>
  
  <p>I already tried <code>mysql_insert_id($link)</code>, where I linked <code>$link</code> to a <code>mysql_connect()</code> and <code>mysql_insert_id($GLOBALS['DB']-&gt;MySQLiObj)</code></p>
  
  <p>My $GLOBAL['DB']</p>
  
  <pre><code>if(!isset($GLOBALS['DB']))$DB = new \System\Database\MySQL(MYSQL_HOST,MYSQL_BENUTZER,MYSQL_KENNWORT,MYSQL_DATENBANK,MYSQL_PORT);
  </code></pre>
  
  <p>My MySQL class:</p>
  
  <pre><code>public $MySQLiObj = null;
  
  function __construct($server, $user, $password, $db, $port = '3306')
  {
  
      $this-&gt;MySQLiObj = new \mysqli($server, $user, $password, $db, $port);
  
      if (mysqli_connect_errno())
      {
          echo "Keine Verbindung zum MySQL-Server möglich.";
          trigger_error("MySQL-Connection-Error", E_USER_ERROR);
          die();
      }
  
      $this-&gt;query("SET NAMES utf8");
  }
  </code></pre>