title: PHP - MySQL Database shows up on webpage but with wrong information and in wrong spots
body: <p>I have a database in MySQL, but the table isn't taking in the right information. For instance, When I run my code, the table I have in excel and now in MySQL automatically appear on my webpage, but the data is both wrong and almost all in the wrong spot. The only correct part is the player Number and Name are in the right spot, but even then, the entire name doesn't even show. then the position column is all random Letters, and then height is in weight, weight in age, and so on and so forth.</p>
  
  <p>Also, My excel sheet has all the stuff correctly of course. I'm just not sure why when creating this database it's being fed wrong information</p>
  
  <p>This is my entire PHP Code:</p>
  
  <pre><code>&lt;?php        
  
       $db_conn = mysqli_connect("localhost", "root", "");
       if (!$db_conn)
          die("Unable to connect: " . mysqli_connect_error());  // die is similar to exit
  
       mysqli_query($db_conn, "CREATE DATABASE IF NO EXISTS bearsroster;");
  
       if (mysqli_query($db_conn, "CREATE DATABASE bearsroster;"))
          echo "Database ready&lt;br&gt;";
       else
          echo "Unable to create database: " . mysqli_error($db_conn) . "&lt;br&gt;";
  
      mysqli_select_db($db_conn, "bearsroster");
  
      $cmd = "CREATE TABLE sportDatabase (    number int(2) NOT NULL PRIMARY KEY,
                                              playerName char(50),
                                              position varchar(2),
                                              height char(3),
                                              weight int(3),
                                              age int(2),
                                              experience int(2),
                                              collegeName char(60)
                                          );";         //Creates the table
        mysqli_query($db_conn, $cmd);
  
        $cmd = "LOAD DATA LOCAL INFILE 'bearsRoster.csv' INTO TABLE sportDatabase FIELDS TERMINATED BY ',';";
        mysqli_query($db_conn, $cmd);
  
        echo "&lt;h1&gt;football database contents&lt;/h1&gt;";
        $cmd = "SELECT * FROM sportDatabase";
        $records = mysqli_query($db_conn, $cmd); 
  
        echo( "&lt;table border = 'black' align:'center'&gt; 
                      &lt;tr&gt; 
                      &lt;th&gt;Number&lt;/th&gt; 
                      &lt;th&gt;Player Name&lt;/th&gt; 
                      &lt;th&gt;Position&lt;/th&gt; 
                      &lt;th&gt;Height&lt;/th&gt; 
                      &lt;th&gt;Weight&lt;/th&gt; 
                      &lt;th&gt;Age&lt;/th&gt;
                      &lt;th&gt;Experience&lt;/th&gt; 
                      &lt;th&gt;College Name&lt;/th&gt;
                      &lt;/tr&gt;" . PHP_EOL  );
  
       //Prints out the table
      while($row = mysqli_fetch_array($records)){
          echo( "&lt;tr&gt; 
                  &lt;td id = 'yellow'&gt;" . $row['number'] . "&lt;/td&gt; 
                  &lt;td id = 'red'&gt;" . $row['playerName'] . "&lt;/td&gt; 
                  &lt;td id = 'red'&gt;" . $row['position'] . "&lt;/td&gt; 
                  &lt;td id = 'blue'&gt;" . $row['height'] . "&lt;/td&gt;
                  &lt;td id = 'blue'&gt;". $row['weight'] . "&lt;/td&gt;
                  &lt;td id = 'blue'&gt;". $row['age'] . "&lt;/td&gt;
                  &lt;td id = 'pink'&gt;". $row['experience'] . "&lt;/td&gt;
                  &lt;td id = 'pink'&gt;". $row['collegeName'] . "&lt;/td&gt;
  
                  &lt;/tr&gt;". PHP_EOL );
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/uGo6P.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uGo6P.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/tz9hw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tz9hw.png" alt="enter image description here"></a></p>