title: My SQL Ajax table keeps repeating ID's, Usernames, etc on the table
body: <p>I'm building a database table for class where I must present data from MySQL database into the table. </p>
  
  <p>The issue i'm having is that after 100 ID's, the usernames and everything repeat. Screenshot: <a href="https://imgur.com/a/vKfzA" rel="nofollow noreferrer">http://imgur.com/a/vKfzA</a></p>
  
  <p>I'm a huge coding noob and trying everything and can't seem to fix it</p>
  
  <hr>
  
  <p>Here's my code</p>
  
  <pre><code>&lt;?php
  
  //connection to DB
  require "connectionPages/remoteConnect.php";
  
  $userSQL = "SELECT * FROM USER, CUSTOMER";          
  
  $result = $mysqli-&gt;query($userSQL);
  
  $pTable =   "&lt;div class='table'&gt;
          &lt;div class='heading'&gt;
              &lt;div class='cell'&gt;&lt;/div&gt;
              &lt;div class='cell'&gt;ID&lt;/div&gt;
              &lt;div class='cell'&gt;userName&lt;/div&gt;
              &lt;div class='cell'&gt;custEmail&lt;/div&gt;
              &lt;div class='cell'&gt;Last Name&lt;/div&gt;
          &lt;/div&gt;";
  
  while($row = $result-&gt;fetch_array())
  {
      $ID             = $row['userID'];
      $userName   = $row['userName'];
      $custEmail  = $row['custEmail'];
      $userLname  = $row['custLName'];
  
      $pTable .=  "&lt;div class='row'&gt;
                      &lt;div class='cell'&gt;
                          &lt;a class='delete'&gt;Delete&lt;/a&gt;
                          &lt;a class='edit'&gt;Edit&lt;/a&gt;
                          &lt;a class='cancel'&gt;Cancel&lt;/a&gt;
                      &lt;/div&gt;
                      &lt;div class='cell'&gt;&lt;input disabled size='2' type='text' name='txtID' value='$ID'&gt;&lt;/div&gt;
                      &lt;div class='cell'&gt;&lt;input disabled size='25' type='text' name='txtFirst' value='$userName'&gt;&lt;/div&gt;
                      &lt;div class='cell'&gt;&lt;input disabled size='25' type='text' name='txtEmail' value='$custEmail'&gt;&lt;/div&gt;
                      &lt;div class='cell'&gt;&lt;input disabled size='25' type='text' name='txtTeam' value='$userLname'&gt;&lt;/div&gt;
                  &lt;/div&gt;";
  }
  
  //close out table tag
  $pTable .= "&lt;/div&gt;&lt;p&gt;&lt;a href='outputPages/enterUser.php'&gt;Add A User&lt;/a&gt;&lt;/p&gt;";
  
  //close connection to DB
  $mysqli-&gt;close();
  
  $doc = "&lt;!DOCTYPE html&gt;
              &lt;html&gt;
                  &lt;head&gt;
                  &lt;script src='clientCode/jquery-1.12.2.min.js'&gt;&lt;/script&gt;
                  &lt;script src='clientCode/AJAX.js'&gt;&lt;/script&gt;
                  &lt;link rel='stylesheet' type='text/css' href='css/tableStyle.css'&gt;
                  &lt;/head&gt;
              &lt;body&gt;
                  $pTable
              &lt;/body&gt;
          &lt;/html&gt;";
  
  echo $doc;
  
  ?&gt;
  </code></pre>