Estou inserindo valores em uma tabela sql e exibindo-os por meio de AJAX. Os valores são exibidos corretamente, mas a imagem não vem na coluna certa, em vez disso, ela vem no topo. Por que isso acontece?
Embora a imagem seja exibida na página da web, ela está alinhada em posições diferentes.
<?php
...
...
...
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
$output .= '
<div class="table-responsive">
<table class="table table bordered">
<tr>
<th>ID</th>
<th>Name</th>
<th>Time</th>
<th>Img</th>
</tr>
';
while($row = mysqli_fetch_array($result))
{
$output .= '
<tr>
<td>'.$row["ID"].'</td>
<td>'.$row["Name"].'</td>
<td>'.$row["Time"].'</td>
<td>' ?> <img src="<?php echo $row['Img']; ?>" alt="my picture" height="100" width="100" /> <?php '</td> //Here is the problem where I am trying to display the image
</tr>
';
}
echo $output;
}
else
{
echo 'Data Not Found';
}
?>
if(mysqli_num_rows($result) > 0)
{
$output .= '
<div class="table-responsive">
<table class="table table bordered">
<tr>
<th>ID</th>
<th>Name</th>
<th>Time</th>
<th>Img</th>
</tr>
';
while($row = mysqli_fetch_array($result))
{
$output .= '
<tr>
<td>'.$row["ID"].'</td>
<td>'.$row["Name"].'</td>
<td>'.$row["Time"].'</td>
<td> <img src="' .$row["Img"] . '" alt="my picture" height="100" width="100" /> </td> //Here is the problem where I am trying to display the image
</tr>';
}
$output .= '</table></div>';
echo $output;
}
else
{
echo 'Data Not Found';
}
tente desta forma.
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras