title: Echo specific rows from a mysql database
body: <p>I have created a form that ask the user to add:
  first_name, last_name,location,status</p>
  
  <p>After some time i have received 5 inputs. The mysql table is named users and the table data are like below:</p>
  
  <pre><code>id first_name location status  
  == ========== ======== ========  
  1   Chris       UK       Married  
  2   Anton       Spain    Single  
  3   Jacob       UK       Single  
  4   Mike        Greece   Married  
  5   George      UK       Married  
  </code></pre>
  
  <p>Also the way i am receiving the inputs its via POST method. So:</p>
  
  <pre><code>$firstname=$_POST['FIRST_NAME']; // First Name: &lt;input type="text" name="FIRST_NAME"&gt;
  $location=$_POST['LOCATION']; // Location: &lt;input type="text" name="LOCATION"&gt;
  $status=$_POST['STATUS']; // Status: &lt;input type="text" name="STATUS"&gt;
  </code></pre>
  
  <p>I created a query to select all users from UK that are married:</p>
  
  <pre><code>$query = "SELECT * FROM users WHERE location='UK' AND status='Married'";
  $result = mysqli_query($dbc,$query); //$dbc is the connection to my database
  
  $row = mysqli_fetch_array($results, MYSQLI_BOTH);
  </code></pre>
  
  <p>In other words:</p>
  
  <pre><code>id first_name location status  
  == ========== ======== ========  
  1   Chris       UK       Married  
  5   George      UK       Married
  </code></pre>
  
  <p>Questions:</p>
  
  <p><strong>1) Does the $row array look like below:</strong></p>
  
  <pre><code>$row= array(
  array(1 Chris UK Married),
  array(5 George UK Married) 
  );
  </code></pre>
  
  <p><strong>2) How do i echo the content of the database after implementing the filtering WHERE location='UK' AND status='Married'?</strong></p>
  
  <p>i need it to be like this:</p>
  
  <pre><code>Hello Chris! You are from UK and you are married!
  
  Hello George! You are from UK and you are married!
  </code></pre>
  
  <p>I know that i have to use foreach loop (echo arrays) but i have tried it and it doesnt work.One of the things i tried was something i found in php.net:</p>
  
  <p>Unpacking nested arrays with list()</p>
  
  <p>(PHP 5 >= 5.5.0)</p>
  
  <p>PHP 5.5 added the ability to iterate over an array of arrays and unpack the nested array into loop variables by providing a list() as the value. </p>
  
  <p>For example: </p>
  
  <pre><code>&lt;?php
  $array = [
  [1, 2],
  [3, 4],
  ];
  
  foreach ($array as list($a, $b)) {
  // $a contains the first element of the nested array,
  // and $b contains the second element.
  echo "A: $a; B: $b\n";
  }
  ?&gt; 
  </code></pre>
  
  <p>When i use the above i am receiving the error below:</p>
  
  <pre><code>Parse error: syntax error, unexpected T_LIST in C:\wamp\www....
  </code></pre>
  
  <p>Any suggestions?</p>
  
  <p>As i understand, i somehow have to link the ID with the other data..</p>
  
  <p>Thanks in advance.</p>