希望有人可以发现我的错误,但链接没有打印出来。
功能:
function getGames($console) {
$query = 'SELECT * FROM `games` WHERE `console` = ? ORDER BY `name` ASC';
$params = array($console);
$results = dataQuery($query,$params);
foreach ($results as $result) {
echo '<td style="float: left;padding-left: 5px;>';
echo '<a href="?page=ladders/game&id='.$result['id'].'" title="'.$result['name'].'">';
echo '<img src="images/games/'.$result['image'].'" alt="'.$result['name'].'" width="100px" height="100px" />';
echo '</a>';
echo '</td>';
}
}
它打印出的图像很好但不可点击,这意味着<a href
部分出现了某种混乱。不过,这对我来说是正确的。
答案 0 :(得分:1)
<td style="float: left;padding-left: 5px;>
function getGames($console) {
$query = 'SELECT * FROM `games` WHERE `console` = ? ORDER BY `name` ASC';
$params = array($console);
$results = dataQuery($query,$params);
foreach ($results as $result) {
echo '<td style="float: left;padding-left: 5px;">';
echo '<a href="?page=ladders/game&id='.$result['id'].'" title="'.$result['name'].'">';
echo '<img src="images/games/'.$result['image'].'" alt="'.$result['name'].'" width="100px" height="100px" />';
echo '</a>';
echo '</td>';
}
}