title: Joining 2 variables to form a new variable
body: <p>Firstly, I'm using jQuery, PHP, SQL, HTML and CSS.</p>
  
  <p>I have a party list with 4 members. When I access my party detail page I want it to display the 4 members details with listview. </p>
  
  <p>When I open the party detail page, I send a <code>$.post</code> request to my PHP to retrieve the members details from my database.</p>
  
  <p>I then store them in an array in PHP and echo the response:</p>
  
  <pre><code>$row = mysqli_fetch_array($result);
  $mem1 = $row["mem1"];
  $mem2 = $row["mem2"];
  $mem3 = $row["mem3"];
  $mem4 = $row["mem4"];
  
  $result2 = json_encode(array(
      "mem1" =&gt; $mem1, 
      "mem2" =&gt; $mem2, 
      "mem3" =&gt; $mem3, 
      "mem4" =&gt; $mem4
  )); 
  
  echo $result2;
  </code></pre>
  
  <p>Next, I when I go back to my .js file to try and append the result, I can can do that only by calling out one member data. But I want to call 4 of them so i used while loop:</p>
  
  <pre><code>$.post("retrieveDetails.php", 
  {
      teamID:teamID, // data to pass into php                     
  },
  
  function(response)
  {
      console.log(response.mem1 + " " + response.mem2 + " " + response.mem3 + " " + response.mem4);
  
      var x = 1;
      while(x &lt;= 4){
  
          // part i'm stuck at
          member = response.mem + x; 
  
          // if member column is not empty
          if(member != ""){ 
              $("#listview").append('&lt;li&gt; &lt;img src="images/displaypic.jpg"&gt; &lt;h2&gt;'+ member + '&lt;/h2&gt; &lt;/li&gt;').listview("refresh");
              console.log("current addee is " + member);
          }   
          x++;                                
      }                               
  }, 'json'
  
  );
  </code></pre>
  
  <p>I am doing something wrong with <code>member = response.mem + x;</code> </p>
  
  <p>My ultimate result needs to be <code>member = response.mem1</code>, and after the next loop it will become <code>member = response.mem2</code> and so on.. 
  But when I output it via <code>console.log</code> it returns "NaN". </p>
  
  <p>Can somebody advise on a solution? Thanks.</p>