title: Can't get mysql_insert_id() to work
body: <p>I tried this:</p>
  
  <pre><code>$cid = mysql_insert_id($this-&gt;result);
  $this-&gt;result = "&lt;div class='alert alert-success'&gt;" . sprintf(_('Successfully added user id &lt;b&gt;%s&lt;/b&gt; to the database.'), $cid) . "&lt;/div&gt;";
  </code></pre>
  
  <p>but I only get this error:</p>
  
  <p>Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in</p>
  
  <p>This is the entire function (i added this <strong>$cid = mysql_insert_id($this->result);</strong> hoping to retrieve the id of the inserted data):</p>
  
  <pre><code>private function adduser() {
  
      if (!empty($this-&gt;error)) return false;
  
      $params = array(
          ':user_level' =&gt; parent::getOption('default-level'),
          ':name'       =&gt; $this-&gt;name,
          ':email'      =&gt; $this-&gt;email,
          ':username'   =&gt; $this-&gt;username,
          ':password'   =&gt; parent::hashPassword($this-&gt;password)
      );
  
      parent::query("INSERT INTO `login_users` (`user_level`, `name`, `email`, `username`, `password`)
                      VALUES (:user_level, :name, :email, :username, :password);", $params);
  
      $shortcodes = array(
          'site_address'  =&gt;  SITE_PATH,
          'full_name'     =&gt;  $this-&gt;name,
          'username'      =&gt;  $this-&gt;username,
          'email'         =&gt;  $this-&gt;email,
          'password'      =&gt;  $this-&gt;password
      );
  
      $subj = parent::getOption('email-add-user-subj');
      $msg = parent::getOption('email-add-user-msg');
  
      if(!parent::sendEmail($this-&gt;email, $subj, $msg, $shortcodes))
          $this-&gt;error = _('ERROR. Mail not sent');
      $cid = mysql_insert_id($this-&gt;result);
      $this-&gt;result = "&lt;div class='alert alert-success'&gt;" . sprintf(_('Successfully added user &lt;b&gt;%s&lt;/b&gt; to the database. Credentials sent to user.'), $cid) . "&lt;/div&gt;";
  
  }
  </code></pre>
  
  <p>This is the connection to the database:</p>
  
  <pre><code>&lt;?php
  $host = "xxx"; 
  $dbName = "xxx"; 
  $dbUser = "xxx"; 
  $dbPass = "xxx"; 
  ?&gt;
  </code></pre>