$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)) { ?>
<tr>
<td><?php echo $row['pk_slider_id'] ?></td>
echo "<tr><td>".$row['slider_image']."</td><td><img src='img/".$row[slider_image].".png' style='width:175px;height:75px;'/></td></tr>";
<td>
答案 0 :(得分:0)
尝试此代码;
$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 } ?>