How I can display image from mysql into table in php

Try this code;

 $servername = "localhost"; $username = "root"; $password   = ""; $database   = "cyclist";
    $conn= new mysqli($servername,$username,$password,$database );

    $sql="SELECT * FROM slider "; $result=mysqli_query($conn,$sql);


    <table id="example2" class="table table-bordered table-hover">
        <thead>
            <tr>
                <th>S.No</th>
                <th>Slider Image</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
    <?php while ($row = mysqli_fetch_assoc($result)) { 

         $image=$row[slider_image];

    ?>
            <tr>
                <td><?php echo $row['pk_slider_id'] ?></td>
      <tr><td><img src=<?php echo $image;?> style="width:175px;height:75px;"/></td></tr>
                <td></td>
<?php } ?>

Leave a Comment