title: How to insert a value into an auto_increment of a different table in the same string
body: <p>I am using <code>mysqli_multi_query</code> to insert user's information and a default null profile photo, there are two tables for that, <code>"esc_usuarios"</code> for the personal data and <code>"esc_usuarios_fotos"</code> for the photos. </p>
  
  <p>What do I want is, after inserting the personal data, insert this null image in the <code>"esc_usuarios_fotos"</code> table binding <code>"img_usu_codigo"</code> with this inserted person, the person's id is being auto incremented in the column <code>"usu_codigo"</code> from the table <code>"esc_usuarios"</code>.</p>
  
  <p>The query:</p>
  
  <pre><code>&lt;?php
  $inserir_usuario = "INSERT INTO `esc_usuarios` 
      (
          usu_nome, 
          usu_senha, 
          usu_sobrenome, 
          usu_cpf, 
          usu_rg, 
          usu_nasc, 
          usu_endereco, 
          usu_numero, 
          usu_bairro, 
          usu_cep, 
          usu_cidade, 
          usu_uf, 
          usu_tel, 
          usu_cel, 
          usu_genero, 
          usu_email, 
          usu_indicador_codigo, 
          usu_datacadastro
      ) VALUES (
          '$nome', 
          '".md5('$password')."', 
          '$sobrenome', 
          '$cpf', 
          '$rg', 
          '$nascimento', 
          '$endereco', 
          '$numero', 
          '$bairro', 
          '$cep', 
          '$cidade', 
          '$uf', 
          '$tel', 
          '$cel',
          '$genero', 
          '$email', 
          '" . $_SESSION['codigo'] . "', 
          '$trn_date'
      );
      INSERT INTO esc_usuarios_fotos(img_local,img_usu_codigo) VALUES ('null', //i want to insert here the inserted person's id  "usu_codigo" of the first insert statement)";
  
  $re = mysqli_multi_query($conexao, $inserir_usuario);
  </code></pre>