title: Generate product page with PHP and mySQL
body: <p>I'm a beginner so this may ba a stupid one.
  I'm creating simple platform, which uses a database to manage my post stamps collection. I've managed to set up a database and gather new stamps from user. Now I want to create kind of "product page", which will use data from mySQL. You will be able to enter this page through a dynamically generated table, which will contain all stamps in the database.</p>
  
  <p>The code,which generates a simple table is here:</p>
  
  <pre><code>        //connect to database
      $db = mysqli_connect(database login data);
      if(mysqli_connect_errno()){
          echo "Jest problem z podłączeniem się do bazy danych. Skontaktuj się z administratorem.";
          die();
      }
      // loop through results of database query, displaying them in the table
      $result = mysqli_query($db,"SELECT * FROM stamps");
      ?&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;?php include "navbar.php" ?&gt;
      &lt;h1&gt;Przeglądaj swoją kolekcję.&lt;/h1&gt;
      &lt;?php
      echo "&lt;p&gt;&lt;b&gt;View All&lt;/b&gt;";
  
      echo "&lt;table border='1' cellpadding='10'&gt;";
                  echo "&lt;tr&gt; &lt;th&gt;ID&lt;/th&gt; &lt;th&gt;Nazwa&lt;/th&gt; &lt;th&gt;Kraj&lt;/th&gt; &lt;th&gt;Wartość nominalna&lt;/th&gt; &lt;th&gt;Wartość rynkowa&lt;/th&gt; &lt;th&gt;Klaser&lt;/th&gt; &lt;th&gt;More info&lt;/th&gt; &lt;th&gt;Edytuj&lt;/th&gt; &lt;th&gt;Usuń&lt;/th&gt;&lt;/tr&gt;";
                  while($row = mysqli_fetch_object($result)) {
  
                  // echo out the contents of each row into a table
                  echo "&lt;tr&gt;";
                              echo '&lt;td&gt;' . $row-&gt;id . '&lt;/td&gt;';
                              echo '&lt;td&gt;' . $row-&gt;name . '&lt;/td&gt;';
                              echo '&lt;td&gt;' . $row-&gt;country . '&lt;/td&gt;';
                              echo '&lt;td&gt;' . $row-&gt;price . '&lt;/td&gt;';
                              echo '&lt;td&gt;' . $row-&gt;estimated . '&lt;/td&gt;';
                              echo '&lt;td&gt;' . $row-&gt;album . '&lt;/td&gt;';
                              echo "&lt;td&gt;&lt;a href=\"stamp.php\"&gt;More info.&lt;/a&gt;&lt;/td&gt;";
                              echo '&lt;td&gt;&lt;a href="edit.php?id=' . $row-&gt;id . '"&gt;Edit&lt;/a&gt;&lt;/td&gt;';
                              echo '&lt;td&gt;&lt;a href="delete.php?id=' . $row-&gt;id . '"&gt;Delete&lt;/a&gt;&lt;/td&gt;';
                  echo "&lt;/tr&gt;";
                  }
                  // close table&gt;
      echo "&lt;/table&gt;";
      ?&gt;
  </code></pre>
  
  <p>Now, I'd like to post database values to another page, after clicking "More info" and just view it something like that:</p>
  
  <pre><code>&lt;body&gt;
      &lt;?php include "navbar.php" ?&gt;
      &lt;div class="jumbotron"&gt;
          &lt;img class="photo" src="http://placehold.it/250x250"&gt;
          &lt;h1&gt;Znaczek z XIX wieku&lt;/h1&gt; &lt;!-- database data goes here --&gt;
          &lt;h3&gt;Informacje:&lt;/h3&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Numer katalogowy:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Rok wydania:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Kraj:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Wartość nominalna:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Wartość rynkowa:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;Klaser:&lt;/h5&gt; &lt;!-- database data goes here --&gt;
          &lt;h3&gt;Opis:&lt;/h3&gt; &lt;!-- database data goes here --&gt;
          &lt;h5&gt;&lt;div&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, aliquam, tenetur voluptatibus veritatis numquam expedita nesciunt quos repudiandae similique atque provident ipsam dolorem recusandae id possimus minus ea eum cupiditate!&lt;/div&gt;
          &lt;div&gt;Sint, debitis, saepe repellendus commodi recusandae error architecto voluptates soluta ipsa facere perferendis aspernatur quo atque fugiat consequatur! Assumenda necessitatibus dolorem esse distinctio incidunt pariatur praesentium veniam voluptate quae quaerat!&lt;/div&gt;&gt;&lt;/h5&gt;
          &lt;p&gt;&lt;a class="btn btn-primary btn-lg" role="button"&gt;Edytuj&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;?php include "footer.php" ?&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The question is: what is the best way to do it ?
  Thanks in advance !</p>