title: How to retrieve multiple values from MySQL with app inventor + PHP?
body: <p>To store in MySQL I had to use the 'explode' PHP function, so each value would go to each attribute, and it works fine, however when I try to retrieve a row with all the values in it, it just displays the 'tag' (let's say forename) and 'value' (let's say surname), but all the other attributes is repeated with the surname. Example:</p>
  
  <pre><code>Forename: John
  Surname:  Walker
  Age:      Walker
  Phone:    Walker
  </code></pre>
  
  <p>Where the last 2 'Walker' would be another attribute value such as Age and Phone.</p>
  
  <p>Thanks in advance!!!</p>
  
  <p>Here is part of my Retrieval PHP code:</p>
  
  <pre><code>mysql_query($query);
  $forename=$_POST['tag'];
  $forename = trim($forename);
  $query =  sprintf("select `forename`, `surname`, `age`, `phone` from `tinywebdb` where `forename` = '%s' limit 1", mysql_real_escape_string($forename));
  if($link){ $result=mysql_query($query) ;}     
  if($entry = mysql_fetch_assoc($result)) 
  {
      $forename = $entry["forename"];
      $surname = $entry["surname"];
      $age = $entry["age"];
      $phone = $entry["phone"];
  } 
  else 
  {
      fwrite($fh,"No Entry found in MYSQL for name : ". mysql_real_escape_string($forename));
  }
  echo json_encode(array("value", $forename, $surname, $age, $phone));
  </code></pre>