title: The word "array" prints instead of databse information
body: <p>My code keeps on print the word "array" instead of the database information. When i try to use <code>print_r()</code> or <code>var_dump()</code> it echos all the information about the array </p>
  
  <p>this is with <code>var_dump</code> </p>
  
  <p>array(1) { ["Team"]=> string(8) "Oakville" } array(1) { ["Team"]=> string(8) "Brampton" } array(1) { ["Team"]=> string(7) "Toronto" } array(1) { ["Team"]=> string(11) "Mississauga" }</p>
  
  <p>Here's my code</p>
  
  <pre><code>if(isset($_REQUEST['submit2'])){
  $leaguename = $_POST['league'];
  $db_host = '**';
  $db_user = '**';
  $db_pwd = '**';
  $database = '**';
  $db = new mysqli($db_host, $db_user, $db_pwd, $database);
  
  
  $sql = "SELECT Team FROM Games WHERE League = '$leaguename' AND Team &lt;&gt; ''";
  
  $result = mysqli_query($db, $sql) or die ("no query");
  
  if (!$result) {
      die('Invalid query: ' . mysqli_error());
  }
  
  $array = array();
  while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
      $array[] = $row;
  }
  
  $teamnumber=count($array);
  echo $teamnumber . "&lt;br&gt;";
  
  foreach($array as $teams=&gt;$team){
      var_dump($team);
  }
  </code></pre>
  
  <p>I'm trying to print the names of sports teams that are being fetched from a database and put into an array. </p>