title: PHP: Fatal error: Call to undefined method mysqli
body: <p>Okay I asked a question last week.  I got a few answers, several which did not help; however, I decided to recheck all of my connections.  That did resolve some problems after I had to check here to make it function.  Next was for some reason I did not check my query to make sure it worked in mysql.  I also noticed that my version has a way to output the query into PHP code which I did.  Now I am stuck with the error code: </p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method mysqli::SELECT tblConference.colConferenceName, tblSchool.colSchoolName, tblSchool.colClass, tblSurface.colSurfaceName, tblSurface.colSurfaceCompany, tblStadium.colStadiumName, tblStadium.colAddress, tblStadium.colCity, tblStadium.colRegion, tblStadium.colCounty, tblStadium.colCapacity FROM tblStadium, tblConference, tblSurface, tblSchool, tblStadiumSchool WHERE tblConference.colConferenceID = tblSchool.colConferenceID AND tblSurface.colSurfaceID = tblStadium.colSurfaceID AND tblStadium.colStadiumID = tblStadiumSchool.colStadiumID AND tblSchool.colSchoolID = tblStadiumSchool.colSchoolID AND tblSchool.colSchoolName LIKE \'A%\' ORDER BY tblSchool.colSchoolName() in C:\xampp\htdocs\stadium\alpha\a.php on line 24</p>
  </blockquote>
  
  <p>Now here is my new code, I will try to make it look halfway decently, </p>
  
  <pre><code>    $mysqli = new mysqli("localhost", "root", "", "dbstadium");
      /* check connection */
        if (mysqli_connect_errno()) {
          printf("Connect failed: %s\n", mysqli_connect_error);
          exit();
          }
      /* your sql query */
  </code></pre>
  
  <blockquote>
    <p>$sql = "SELECT tblConference.colConferenceName, tblSchool.colSchoolName, tblSchool.colClass, tblSurface.colSurfaceName, tblSurface.colSurfaceCompany, tblStadium.colStadiumName, tblStadium.colAddress, tblStadium.colCity, tblStadium.colRegion, tblStadium.colCounty, tblStadium.colCapacity FROM tblStadium, tblConference, tblSurface, tblSchool, tblStadiumSchool WHERE tblConference.colConferenceID = tblSchool.colConferenceID AND tblSurface.colSurfaceID = tblStadium.colSurfaceID AND tblStadium.colStadiumID = tblStadiumSchool.colStadiumID AND tblSchool.colSchoolID = tblStadiumSchool.colSchoolID AND tblSchool.colSchoolName LIKE \'A%\' ORDER BY tblSchool.colSchoolName";</p>
  </blockquote>
  
  <pre><code>/* query your db */
  if ($result = $mysqli-&gt;$sql($sql)) {
      /* fetch associative array */
      while ($row = $sql-&gt;fetch_assoc())
      { /* display row */    
          echo '&lt;p&gt;School Name: ' . $row['colSchoolName'] . '&lt;/br&gt;Conference: ' . $row['colConferenceName'] . '&lt;/br&gt;Class: ' . $row['colClass'] . '&lt;/br&gt;Stadium Name: ' . $row['colStadiumName'] . '&lt;/br&gt;Address: ' . $row['colAddress'] . '&lt;/br&gt;City: ' . $row['colCity'] . '&lt;/br&gt;County: ' . $row['colCounty'] . '&lt;/br&gt;Region: ' . $row['colRegion'] . '&lt;/br&gt;Capacity: ' . $row['colCapacity'] . '&lt;/br&gt;Surface Type: ' . $row['colSurfaceName'] . '&lt;/br&gt;Surface Company: ' . $row['colSurfaceCompany'] . '&lt;/br&gt;Year Installed: ' . $row['colSurfaceYear'] . '&lt;/p&gt;';
      }
      /* free result set */
      $result-&gt;free();
  }
      /* close connection */
      $mysqli-&gt;close();
  </code></pre>
  
  <p>Now I am not sure what the issue is.  I been trying to get this to work.  BTW just so you know the query and connection should not be an issue.  If their is something I am missing just let me know.</p>