title: How do I display a logged in user's images from the database?
body: <p>Say if a user uploaded multiple images to their profile page, how would I display that specific user's images? I tried I did something like this:</p>
  
  <pre><code>$db = mysqli_connect("localhost", "root", "", "testdb");
          $sql = "SELECT * FROM users ORDER BY id DESC";
          $result = mysqli_query($db, $sql);
          while ($row = mysqli_fetch_array($result)) {
              echo "&lt;a href='profiles/uploads/".$row['image']."&gt; ";
                  echo "&lt;img  id='img_div' title='".$row['image']."' alt='".$row['image']."'  src='profiles/uploads/".$row['image']."'/&gt;";
                  //echo "&lt;p id='img_div'&gt;".$row['desc']."&lt;/p&gt;";
                  echo "&lt;/a&gt;";
  </code></pre>
  
  <p>But I feel like this is terribly wrong because it is showing everyone's images and not the user's images. I tried looking up answers, but can't seem to find one.</p>