title: automatically create new pages with php and mysqli
body: <p>still getting my feet wet with php and mysqli, have so much to learn, but at this point this question is one of my most important priorities.</p>
  
  <p>I did some research about this issue but am currently overwhelmed by pretty sophisticated stuff for my level, to be honest. I'd like to find the simplest most efficient way to "automatically" generate a great number of pages each with varying data in it.</p>
  
  <p>the example of page 1's code below is <em>extremely</em> simplified, because the actual page actually has a lot more stuff, but the simplified example serves, I hope, to make my point.</p>
  
  <pre><code>&lt;?php
  
  $servername = "servername";
  $username = "username";
  $password = "password";
  $db= "db";
  
  $conn = mysqli_connect("servername","username","password","db");
  
  
  $query = "SELECT word FROM demo WHERE group=1";
  $result = $conn-&gt;query($query);
  $row = mysqli_fetch_assoc($result);
  $word = $row['word'];
  
  echo $word;
  
  ?&gt;
  </code></pre>
  
  <p>in my table I have / would have something like 500 entries (records?) in the 'group' column, numbered 1, 2, 3 etc all the way to 500.
  for my specific purpose, I absolutely need to create as many online pages as there are groups -- in this example, 500 pages.</p>
  
  <p>page 2's echo would have to refer to group 2, page 3's echo would have to refer to group 3, and so on.</p>
  
  <p>obviously, there's a way to do this without copying and pasting the code 500 times and manually changing the group in each! haha. but what's the simplest way?</p>
  
  <p>thank you in advance for any understanding and help, and either way, have an awesome day.</p>