title: Call to a member function prepare() on a non-object PHP Help
body: <p>I am trying to write a PHP function. It is very simple. It is just a prepared statement that queries the database, but I can not get this to work. I keep recieving the error Call to a member function prepare() on a non-object. here is the code:</p>
  
  <pre><code>$DBH = new mysqli("host", "test", "123456", "dbname");
  function selectInfo($limit, $offset){
      $stmt = $DBH-&gt;prepare("SELECT * FROM information LIMIT ?,?");
      $stmt-&gt;bind_param("ii", $limit, $offset);
      $stmt-&gt;execute();
      }
  selectInfo();
  </code></pre>
  
  <p>Any time I call the function i get that error. Can someone please help?</p>