title: cant catch assoc array, confirmed that there is results there but wont select and show
body: <p>This could be a simple syntax error but I've tried every I know how. I have a database class for selecting data</p>
  
  <pre><code>&lt;?php
    /* this script is for creating a class to connect to the database */
  
    include "includes/config.php";
  
    class database {
      protected static $connection; // variable to hold the mysqli connection
  
  
    protected function connect(){
        if (!isset(self::$connection)){ // if the connection variable is not set
            self::$connection = new mysqli(SERVER_NAME, USERNAME, PASSWORD, DB_NAME); // set the connection
        }
        if (self::$connection === false){ //in case connection failed return false
          return false;
        }
        else {
          return self::$connection; // returns the connection
        }
      }
  
  
  
      protected function query($query){ // public function to take a sql query
        $connection = $this-&gt;connect(); // calls the connect function to create a connection to the database
        $result = $connection-&gt;query($query); // puts the query into the result variable
        return $result; //returns the result
      }
  
  
  
      public function select($query){
        $rows = array();
        $result = $this-&gt;query($query);
        if($result === false){
          return false;
        }
        while($row = $result-&gt;fetch_assoc()){
              $rows[] = $row;
              }
          return $rows;
      }
  
  
  
      public function error(){
        $connection = $this-&gt;connect();
        return $connection-&gt;error;
      }
    }
  ?&gt;
  </code></pre>
  
  <p>I have instantiated this in index.php. I made a query and passed it to the select method then ran an if statement to say that if the size of the result is greater than or equal to 1 then echo query successfully. Here's where I keep screwing up. I'm trying to just print out the value of first_name but no matter what way I try it won't print. is this a 2d associative array?</p>
  
  <pre><code>&lt;?php
  
    include 'view/header.php';
    include 'includes/connect.php';
  
    $db = new database();
  
    $sql = "SELECT `first_name`, `last_name` FROM `pratts_db`
            WHERE `first_name` = `clive`;";
  
    $result = $db-&gt;select($sql);
  
    if (sizeof($result) &gt;= 1){
      echo "query successful";
      echo "&lt;p&gt;{$result[`first_name`]}&lt;/p&gt;";
    }
  
    include 'view/footer.php';
  
  ?&gt;
  </code></pre>
  
  <p>I've tried it with different quotation marks, tried selecting 0 position then the first_name and it doesn't work. what am I missing?</p>