title: In MySQL database how can I create a different key for a field that repeats more than once in a row by php and json
body: <p>I created a relationship between a table and another table whose fields are repeated twice in a row and the result was new when the experiment on phpMyAdmin but when the experiment on PHP and printed as Gausson, the results were not displayed as required, where he printed a field twice and did not print the other field</p>
  
  <pre><code>&lt;?php
    include_once("include/config.php");
    header('Content-Type:text/html; charset=utf-8');
    $sql = "
    SELECT po.post_id
         , po.title_post
         , po.user_id
         , po.admin_id 
         , us.id
         , us.fname
         , us.lname 
         , aus.id
         , aus.fname
         , aus.lname 
      FROM postmy po 
      JOIN dataUser us 
      JOIN dataUser aus 
        ON po.user_id = us.id 
       AND po.admin_id = aus.id 
     ORDER 
        BY po.post_id ASC
    ";
  $r = mysqli_query($conn,$sql);
  $result = array();
   while($row = mysqli_fetch_array($r)){
     array_push($result,array(
    "post_id"=&gt;$row['post_id'],
    "title_post"=&gt;$row['title_post'],
    "user_id"=&gt;$row['user_id'],
    "admin_id"=&gt;$row['admin_id'],
    "us.id"=&gt;$row['id'],
    "us.fname"=&gt;$row['fname'],
    "us.lname"=&gt;$row['lname'],
    "aus.id"=&gt;$row['id'],
    "aus.fname"=&gt;$row['fname'],
    "aus.lname"=&gt;$row['lname']        
   ));    
   }
   echo json_encode(array('result'=&gt;$result));
   mysqli_close($conn);   
  ?&gt;
  </code></pre>