title: I don't get all the data from mysql - PHP
body: <p>I've been searching for this for while but didn't find anything related.
  So my problem is that I do get all the data from mysql with while(). However, all the articles I am trying to get displays as only 1 article even though the content is different. Sorry, it's not easy to explain that but see pictures below:</p>
  
  <p>My database:</p>
  
  <p><a href="https://i.stack.imgur.com/bgded.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bgded.png" alt="My database"></a></p>
  
  <p>How it is displayed:</p>
  
  <p><a href="https://i.stack.imgur.com/7JlkQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7JlkQ.png" alt="How it is displayed"></a></p>
  
  <p>my articlesFunction.php code:
      
  
  <pre><code>// check if user is logged in to view the content:
  if(!isset($_SESSION['loggedin']) &amp;&amp; !isset($_SESSION['loggedinAdmin'])){
      header("Location: login.php");
  }else{
  
  }
  
  //
  $sql = "SELECT * FROM `articles` ORDER BY id DESC";
  $result = mysql_query($sql);
  
  while($row = mysql_fetch_assoc($result)){
      $displayUsername = $row['username'];
      $displayArticleName = $row['name'];
      $displayArticleDescription = $row['description'];
  
      $fullArticle = 'Article name: '.$displayArticleName.'&lt;br/&gt; This article was posted by: '.$displayUsername.'&lt;br/&gt;'.$displayArticleDescription.'&lt;hr/&gt;';   
  }?&gt;
  //
  </code></pre>
  
  <p>my articles.php:</p>
  
  <pre><code>    &lt;?php 
      ///////////////////////////////////////////////////////////////////////////////////////
      //                                  UNFINISHED                                       //
      ///////////////////////////////////////////////////////////////////////////////////////
      session_start(); 
      require_once 'connect.php';
      include 'articlesFunction.php';
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;Blog posts&lt;/title&gt;
      &lt;link rel="stylesheet" href="css/articles.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="bannerDiv" style="background-image: url(images/banner.jpg); background-size: 100% 100%; height:150px;"&gt;
          &lt;h2 id="bannerTitle"&gt;&lt;u&gt;&lt;i&gt;Articles about travel that everyone loves...&lt;/i&gt;&lt;/u&gt;&lt;/h2&gt;
          &lt;p&gt;&lt;a href="index.php"&gt;Homepage&lt;/a&gt;&lt;/p&gt;
          &lt;span id="BannerMenu"&gt;&lt;?php echo 'logged in as: '.$_SESSION['username'].' ';?&gt;&lt;/span&gt;&lt;a href="logout.php"&gt;&lt;button&gt;Logout&lt;/button&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id="container"&gt;
          &lt;div id="articles"&gt;
              &lt;div id="Display Articles"&gt;
              &lt;h1&gt;&lt;u&gt;Our set of articles:&lt;/u&gt;
              &lt;/h1&gt;
              &lt;div id="display"&gt;
              &lt;?php
                  echo $fullArticle;
              ?&gt;
              &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So, I hope you understand my issue now. First, in this example, when I put it alone in the div, I only get the oldest article and I get only 1. If I add a while to the div, It gives me the results in the picture above: </p>
  
  <p>So, how can I display the articles (all of them) and each one to be different as they are in the database.</p>