title: Get data MySQL DB and display on in HTML
body: <p>How would I code into my program using PHP/JavaScript and HTML/CSS to display data from a database I made in MySQL Monitor on the blue section below:</p>
  
  <p><a href="https://i.stack.imgur.com/b7z3c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7z3c.png" alt="enter image description here"></a></p>
  
  <p>I made buttons that use PHP to go into the database and show the data on the HTML page:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form action="fullridez.php" method="post"&gt;
          &lt;h4 id="Filter"&gt;GPA&lt;/h4&gt;
          &lt;input id="FilterBox" name="gpa" type="text"/&gt;
          &lt;h4 id="Filter"&gt;Amount&lt;/h4&gt;
          &lt;input id="FilterBox" name="amount" type="text"/&gt;
          &lt;h4 id="Filter"&gt;School&lt;/h4&gt;
          &lt;input id="FilterBox" name="school" type="text"/&gt;
         &lt;input  type="submit" id="FilterBox" name="myForm" onkeypress="checkEnter()" &gt;&lt;img src="search.png" width=15 height=15 /&gt;&lt;/button&gt;
        &lt;/form&gt;
        &lt;script&gt;
        &lt;/script&gt;
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>   &lt;?php
  </code></pre>
  
  <p>if(isset($_POST['myForm'])) {</p>
  
  <pre><code>$servername = "localhost";
  $username = "root";
  $password = "";
  $database = "scholarshiplist";
  
   $conn = mysqli_connect($servername, $username, $password, $database);
  
   $gpa = $_POST['gpa'];
   $amount = $_POST['amount'];
  
  
   $count = "SELECT * FROM scholarships";
   $result = mysqli_query($conn, $count);
  
   if ($result-&gt;num_rows &gt; 0) {
      $sql = "SELECT * FROM scholarships WHERE GPA &lt;= " . $gpa . " AND Amount &lt;= " 
      . $amount;
  
       if ($result = mysqli_query($conn, $sql)) {
          while ($row=mysqli_fetch_row($result)) {
              for($i = 0; $i &lt; count($row); $i++) {
                  echo $row[$i] . '&lt;br&gt;';
              }
          } 
       }
  
   } else {
       echo "0 results";
  }
  
  $conn-&gt;close();
  </code></pre>
  
  <p>}</p>
  
  <p>SQL:</p>
  
  <pre><code>USE ScholarshipList;
  
  CREATE TABLE Scholarships
  (
    id             int unsigned NOT NULL auto_increment, 
    School         varchar(500) NOT NULL,                
    GPA            decimal(10,2) NOT NULL,                
    Amount         decimal(10,2) NOT NULL,               
  
    PRIMARY KEY     (id)
  );
  </code></pre>
  
  <p>I am using XAMPP</p>
  
  <p>When I click the button on the HTML file it bring me to the PHP page and all I see is the PHP code. I don't want it to go to the page but stay on the same page showing the data below the buttons.</p>
  
  <p>This is what the page looks like so far</p>
  
  <p><a href="https://i.stack.imgur.com/ofpgM.png" rel="nofollow noreferrer">page</a></p>
  
  <p><a href="https://i.stack.imgur.com/ofpgM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ofpgM.png" alt="enter image description here"></a></p>
  
  <p>What am I doing wrong?</p>