来自数据库的图像被放入一个数组中,然后保存在 $_SESSION 标题中到新页面,但是当回显出它显示的一堆字符行和它的行时......
while($row = mysql_fetch_assoc($query)){
$queryArray[] = $row;
}
}
else {
$_SESSION['error'] = true;
$error = "<hr />0 results for <strong>$searchquery</strong><hr />";
$_SESSION['error'] = $error;
}
if($goodQuery){
$_SESSION['search_output'] = $queryArray;
header("Location: searchpage.php");
exit;
}
然后...
<?php
if(isset($_SESSION['error'])){
echo $_SESSION['error'];
} else {
echo ($_SESSION['count']);
foreach($_SESSION['search_output'] as $value){
$value['id'];
$value['links'];
$value['title'];
$value['page_body'];
$value['thumbs'];
$id = $value['id'];
$title = $value['title'];
$link = $value['links'];
$body = $value['page_body'];
$thumbs = $value['thumbs'];
$search_output .= "<a href='".$link."'>".$title."</a> - $body<br>";}
}
?>
<?php echo $search_output; ?><?php echo $thumbs; ?>
我怎样才能解决这个问题。基本上我希望在每个搜索结果旁边显示一个缩略图。