title: How select data from TABLE 2 join with table 1
body: <p>How i can to select the user that login for to show name in php, the table 1 is for the main users, and the table 2 is extra users, relationated  with main user by ID and ID_ppl</p>
  
  <p>I need show in php the user name that login. but only it show me the main user, Although I login with extra user, And it must show tha name extra user.</p>
  
  <p>For example, i Login with <strong>Juana</strong>, and in php show me <strong>Andres</strong>, the main user; when it must show me Juana name</p>
  
  <p>Table 1 Main users</p>
  
  <pre><code>id |  usuario  | password | token | nivel | estado | 
  ----------------------------------------------------
  1  | Andres    | *****    | e12A1 | 1     | on     |
  ----------------------------------------------------
  </code></pre>
  
  <p>Table 2 extra users</p>
  
  <pre><code>id |  usuario  | password | token | id_ppl | nivel | estado |
  -------------------------------------------------------------
  1  | Juana     | *****    |       | 1      | 2     | on     |
  -------------------------------------------------------------
  2  | Martin    | *****    |       | 1      | 2     | off    |
  -------------------------------------------------------------
  </code></pre>
  
  <p>Php query</p>
  
  <pre><code>$stmt = $conn-&gt;prepare("SELECT T1.id, T1.usuario, T1.token, T1.nivel, T1.estado FROM escolar AS T1 LEFT OUTER JOIN users_extra AS T2 ON T1.id = T2.id_ppl");
  
      $stmt-&gt;bind_param("ss",$usuario, $password); 
       $stmt-&gt;execute(); 
       $stmt-&gt;store_result(); 
       if($stmt-&gt;num_rows &gt; 0){ 
       $stmt-&gt;bind_result($id, $usuario, $token, $nivel, $estado);
       $stmt-&gt;fetch();
  
      $user = array(
       'id' =&gt; $id,
       'usuario' =&gt; $usuario,
       'token' =&gt; $token,
       'nivel' =&gt; $nivel,
       'estado' =&gt; $estado
       );
  </code></pre>