title: How do i display images from MySQL database in a JavaScript image slider?
body: <p>I have following code which gets me all the images from the database. All these images are displayed 3 in a row and then next row starts. i want an image slider that takes all the images from the database and displays them. Any help including a JavaScript code would be very helpful as i'm not really good at it. thanks!</p>
  
  <pre><code>$sql = "SELECT FILE_NAME FROM images LIMIT 0,6";
      $result = mysqli_query($conn, $sql) or die("bad request: $sql");
          $i = 0;
      while($row = mysqli_fetch_assoc($result)) {
          if($i%3 == 0) 
          {
              echo "&lt;tr&gt;";
          }
          echo"&lt;td&gt;&lt;img src='user_data/{$row['FILE_NAME']}' width=200 height=200&gt;&lt;/td&gt;";
          if($i%3 == 2) {
              echo"&lt;/tr&gt;";
          }
      }
  </code></pre>