加载图片

时间:2016-12-21 21:35:52

标签: php html

echo '<table class="table table-striped">
  <tr>
    <th>Character Name</th>
    <th>Ban Reason</th>
    <th>Ban Length</th>
    <th>Proof</th>
    <th>Banned On</th>
  </tr>';

while($row = $result->fetch_assoc()){
    echo '<tr>
    <td><a href="http://steamcommunity.com/profiles/'.$row['steamId'].'">'.$row['charactername'].'</a></td>
    <td>'.$row['banMessage'].'</td>
    <td>'.convertToHumanReadableTime($row['banDuration']).'</td>
    <td>'<img src='".$row['spy']."' />;'</td>
    <td>'.date("m/d/Y", strtotime($row['banTime'])).'</td>
  </tr>';
}
echo '</table>';

图片加载不起作用导致idk它应该得到以db中的.jpg结尾的链接

1 个答案:

答案 0 :(得分:0)

您的报价存在问题。

更改

echo '<tr>
<td><a href="http://steamcommunity.com/profiles/'.$row['steamId'].'">'.$row['charactername'].'</a></td>
<td>'.$row['banMessage'].'</td>
<td>'.convertToHumanReadableTime($row['banDuration']).'</td>
<td>'<img src='".$row['spy']."' />;'</td>
<td>'.date("m/d/Y", strtotime($row['banTime'])).'</td></tr>';

echo '<tr>
<td><a href="http://steamcommunity.com/profiles/'.$row['steamId'].'">'.$row['charactername'].'</a></td>
<td>'.$row['banMessage'].'</td>
<td>'.convertToHumanReadableTime($row['banDuration']).'</td>
<td><img src="'.$row['spy'].'" />;</td>
<td>'.date("m/d/Y", strtotime($row['banTime'])).'</td></tr>';