title: Trying to get values from options using stmt->bind_result; causing fatal error (out of memory)
body: <p>Just like the title says, I am trying to fetch the meta_keys and meta_values from database using mysqli fetch stmt.  The error I am getting is saying out of memory, and references this line in my code:</p>
  
  <pre><code>//Bind result variables
  $select_stmt-&gt;bind_result($id, $key, $value);
  </code></pre>
  
  <p>Im not really sure where or what I am doing wrong, this is that function in its entirety.  My goal is to call the function in another file and pass the userID and option(meta_key) that I would like to retrieve the meta_value for.</p>
  
  <pre><code>function get_options($userid, $option) {
      global $mysqli;
  
  
      $query = "SELECT user_id, meta_key, meta_value FROM user_settings WHERE user_id = ? AND meta_key = ? LIMIT 4";
  
      if($select_stmt = $mysqli-&gt;prepare($query)) {
  
          $select_stmt-&gt;bind_param('ss', $userid, $option);
  
          //Execute the prepared statement
          $select_stmt-&gt;execute();
  
          //Bind result variables
          $select_stmt-&gt;bind_result($id, $key, $value);
  
          //Fetch the values
          while ($select_stmt-&gt;fetch()) {
              printf($key, $value);
          }
  
      }
  }
  </code></pre>