title: Testing php / mysqli connection
body: <p>I am looking for a way to test just the connection portion of a php / mysqli connection.  I am migrating from a LAMP server build on Vista to the same on Ubuntu and am having fits getting mysqli to work.  I know that all of the proper modules are installed, and PhpMyAdmin works flawlessly.  I have migrated a site over and none of the mysqli connections are working.  The error that I am getting is the &quot;call to member function xxx() on non-object&quot; that usually pops up when either the query itself is bad or the query is prepared from a bad connection.  I know that the query itself is good because it works fine on the other server with the exact same database structure and data.  That leaves me with the connection.  I tried to write a very simple test connection and put it in a loop such as ..</p>
  <pre><code>if(***connection here ***) {
      echo &quot;connected&quot;;
  }
  else { 
      echo &quot;not connected&quot;; 
  }
  </code></pre>
  <p>It echoes &quot;connected&quot;, which is great.  But just to check I changed the password in the connection so that I knew it would not be able to connect and it still echoed &quot;connected&quot;.  So, the if / else test is clearly not the way to go....</p>