title: mysqli_insert_id returns 0 constantly
body: <p>can't make mysqli_insert_id work..
  The id is <code>AUTO_INCREMENT</code> but still doesn't work.</p>
  
  <pre><code>$query = "INSERT INTO categoriasdivisiones (titulo, orden, descripcion, id_familiadivisiones) VALUES ('$titulo','$orden', '$descripcion', '$id_familia');";
  
      mysqli_query($base, $query);
  
      $ultimo_id = mysqli_insert_id($base);
  </code></pre>
  
  <p>Here i call the database:</p>
  
  <pre><code>include('../../../php/config.php');
  </code></pre>
  
  <p>the route is ok.</p>
  
  <p>I know the problem in the code is the insert_id function because i have an image where i use this path: </p>
  
  <pre><code>move_uploaded_file($foto['tmp_name'], '../../../imagenes/categoriadivisiones/catdivisiones_'.$ultimo_id.'.'.$extensionfoto.'');
  </code></pre>
  
  <p>And the image is being saved as = catdivisiones_0.png</p>
  
  <p>Hope you can help me.</p>
  
  <pre><code>CREATE TABLE `categoriasdivisiones` (
    `id` int(11) NOT NULL,
    `titulo` text NOT NULL,
    `descripcion` text NOT NULL,
    `imagen` text NOT NULL,
    `orden` text NOT NULL,
    `id_familiadivisiones` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  ALTER TABLE `categoriasdivisiones`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  </code></pre>